SQL Server 2005 Performance Enhancements for Large Queries Joe Chang
When & Why Migrate to 2005 Performance gains in large queries In memory Disk performance Data Warehouse Applications Easiest to migrate Usually internal users Read-only queries
TPC-H benchmark Decision Support Large volumes of data Complex queries – 22 queries, 2 data refresh Power & Throughput metrics Power – run 1 queries at a time Throughput – run multiple concurrent streams
System Details 2003 Oct: SQL Server 2000 EE build Itanium 2 1.5GHz/6M, 64GB, 215 disks 2004 Aug: Oracle 10g EE 16 Itanium 2 1.5GHz/6M, 64GB, 166 disks Unisys ES7000 Aries Jun: SQL 2005 HP Integrity rx Itanium 2 1.6GHz/9M, 64GB, 342 disks 2005 Jul: Oracle 10g R disks OS: Windows Server 2003 Datacenter, SP1 for last
TPC-H 1000GB Results PowerThroughputComposite SQL 20007,330.63,687.45,199.1 Oracle 10g13,614.27,131.39,853.3 SQL 2005*19,241.09, ,637.8 Oracle 10g R2*20, , ,069.9 S2K5 SP1*23, , ,725.9 *1.6GHz/9M processor, others: 1.5GHz/6M
TPC-H 1000GB - Power Q1Q2Q3Q4Q5Q6Q7Q8Q9 Q10Q11Q12Q13Q14Q15Q16Q17Q18 Q19Q20Q21Q22 SQL Oracle 10g SQL X
TPC-H 1000GB - Power
TPC-H 1000GB - Throughput Q1Q2Q3Q4Q5Q6Q7Q8Q9 Q10Q11Q12Q13Q14Q15Q16Q17Q18 Q19Q20Q21Q22 SQL Oracle 10g SQL
TPC-H 1000GB - Throughput
TPC-H Query 1 SQL 2000 to X Power 1.30X Throughput SELECT L_RETURNFLAG,L_LINESTATUS,SUM(L_QUANTITY) AS SUM_QTY, SUM(L_EXTENDEDPRICE) AS SUM_BASE_PRICE, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) AS SUM_DISC_PRICE, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)*(1+L_TAX)) AS SUM_CHARGE, AVG(L_QUANTITY) AS AVG_QTY,AVG(L_EXTENDEDPRICE) AS AVG_PRICE, AVG(L_DISCOUNT) AS AVG_DISC,COUNT(*) AS COUNT_ORDER FROM LINEITEM WHERE L_SHIPDATE <= DATEADD(dd, -90, cast('1998/12/01' as smalldatetime)) GROUP BY L_RETURNFLAG,L_LINESTATUS ORDER BY L_RETURNFLAG,L_LINESTATUS
TPC-H Query 3 SQL 2000 to X Power 3.3X Throughput SELECT TOP 10 L_ORDERKEY, SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT)) AS REVENUE, O_ORDERDATE,O_SHIPPRIORITY FROM CUSTOMER INNER JOIN ORDERS ON C_CUSTKEY = O_CUSTKEY INNER JOIN LINEITEM ON L_ORDERKEY = O_ORDERKEY WHERE C_MKTSEGMENT = 'BUILDING' AND O_ORDERDATE ' ' GROUP BY L_ORDERKEY,O_ORDERDATE,O_SHIPPRIORITY ORDER BY REVENUE DESC,O_ORDERDATE
Query 8 SQL 2000 to X Power 8.9X Throughput
10GB Line Item in memory test SQL Server 2000 SP4 Query time in milli- seconds versus Max Degree of Parallelism Limited parallelism gains beyond 4-8P SQL Server 2005 June CTP Continued parallelism gains beyond 4P
10GB Line Item in memory test 1 SQL Server 2000 SP4 Query time in milli- seconds versus Max Degree of Parallelism Limited parallelism gains beyond 4-8P SQL Server 2005 June CTP Continued parallelism gains beyond 4P
10GB Line Item in memory test 2 SQL Server 2000 SP4 Query time in milli- seconds versus Max Degree of Parallelism Limited parallelism gains beyond 4-8P SQL Server 2005 June CTP Continued parallelism gains beyond 4P
10GB in memory test Max Degree of Parallelism 1 Max DOP 4 Max DOP 16 30% reduction in total time at 1P 50% reduction in total time at 16P
In-Memory Table Scan Xeon systems have better table scan performance on SQL 2000 SQL 2000 default table scan performance depends on build
Table Scan to Disk SQL 2005 Table Scan performance probably limited by disk system
Loop Join – SQL 2000 & 2005 SQL 2000 SQL 2005 No scaling from 1-2P Better overall performance, scaling from 1-8P
Hash Join SQL 2000 SQL 2005 Unpredictable behavior below 3M rows Limited scaling Consistent behavior < 1M rows Not as much fall off in large joins
Merge Join – SQL 2000 SQL 2005 does not use parallel merge joins? Slight decrease in non-parallel performance. SQL 2000 parallel merge joins has serious problems, runs slower, consumes more CPU. It should be possible to performance a parallel merge efficiently?
LiteSpeed Backup Performance HP rx8620, 16 x 1.5GHz Itanium 2 processors 2 EVA 5000 (4 HSV110 controllers, 8 enclosures x14 disks each 8 x 2Gbit/sec FC ports
SQL 2005 Performance Summary Significant improvements in large queries Data Warehouse Applications Improved disk performance
More Information SQL Server Quantitative Performance Analysis Server System Architecture Processor Performance Direct Connect Gigabit Networking Parallel Execution Plans Large Data Operations Transferring Statistics SQL Server Backup Performance with LiteSpeed
System Configuration
Bookmark Lookup Performance SQL 2005 has better bookmark lookup performance to Clustered Indexes SQL 2000 has better bookmark lookup performance to Heap organized tables