Connect Database 'Tpcd Scale 001' User DBA Identified by SQL;

Total Page:16

File Type:pdf, Size:1020Kb

Connect Database 'Tpcd Scale 001' User DBA Identified by SQL;

ASIQ12 Performance and Tuning:- Optimiser Plans OPTIMISER PLAN OUTPUT

Introduction This document serves as an example document to be presented within the confines of the Sybase Business Intelligence Training Course entitled ASIQ12 Performance and Tuning. This document does contain confidential information that must be covered under Non-disclosure documentation. Author Richard Soundy ASIQ Product Specialist January 2000 TPCD Query 5

CONNECT DATABASE 'tpcd_scale_001' USER DBA IDENTIFIED BY SQL;

SET TEMPORARY OPTION query_name = 'tpcd-q5'

SELECT n_name, SUM(l_extendedprice*( 1 – discount)) FROM customer, orders, lineitem, supplier, nation, region WHERE c_custkey = o_custkey AND c _ orderkey = 1_orderkey AND 1_suppkey = s_suppkey AND c_nationkey = s_nationkey AND s_nationkey = n_nationkey AND n_regionkey = r_regionkey AND r name = 'ASIA' AND o orderdate >= '1994-01-01' AND o orderdate < dateadd(year, 1, '1994-01-01') GROUP BY n_name ORDER BY 2 desc; Options for the Query Executions

QUERY PLAN SET TEMPORARY OPTION query_plan = ON

QUERY DETAIL SET TEMPORARY OPTION query_plan = ON SET TEMPORARY OPTION query_detail = ON

QUERY PLAN AND SECURE STATS SET TEMPORARY OPTION query_plan = ON SET TEMPORARY OPTION dml_option10 = ON

QUERY PLAN, DETAIL AND SECURE STATS SET TEMPORARY OPTION query_plan = ON SET TEMPORARY OPTION query_detail = ON SET TEMPORARY OPTION dml_option10 = ON

Sybase (BID) Inc. Quarter 1 2000 Page 1 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans Query Plan (only) for TPCD Query 5 Query Plan: 1 #17: Scrolling Cursor Store Child Node 1: #15 2 . #15: Order By Child Node 1: #14 3 . . #14: Group By (Hash) Child Node 1: #11 Total cached join plans: 25 Total plan cache hits: 64 4 . . . #11: Join (Sort-Merge) Left Child Node: #12 Right Child Node: #13 Valid Join Algorithms: NW, SMJ, HJ, NLPD Left Input Table 1: customer Right Input Table 1: region Right Input Table 2: nation Right Input Table 3: supplier Right input Table 4: lineitem Right Input Table 5: orders Condition 1: (customer.c_nationkey = supplier.s_nationkey) Condition 2: (customer.c_custkey = orders.o_custkey) 5 . . . . #12: Order By Child Node 1: #10 6 . . . . . #10: Join (Hash PushDown) Left Child Node: #04 Right Child Node: #09 Valid Join Algorithms: NW, SMJ, HJ, HPDJ) Left Input Table 1: lineitem Left Input Table 2: orders Right Input Table 1: region Right Input Table 2: nation Right Input Table 3: supplier Condition 1: (lineitem.l_suppkey = supplier.s_suppkey) Condition 2 (Pushed): (lineitem.l_suppkey IN BP(1)) 7 ...... #04: Join (Hash PushDown) Left child Node: #02 Right child Node: #03 Valid Join Algorithms: NLJ SMJ, HJ, HPDJ, MPDJ Left Input Table 1: lineitem Right Input Table 1: orders Condition 1: (lineitem.lorderkey = orders.o_orderkey Condition 2 (Pushed): (lineitem.l_orderkey IN BP(O)) 8 ...... #02: Vertical Cursor Table Name: lineitem Table Row Count: 60175 Condition 1 (Pushed): (lineitem.l_orderkey IN BP(O)) Condi tion 2 (Pushed): (lineitem.l_suppkey IN BP(1)) 8 ...... #03: Vertica1 Cursor Table Name: orders Table Row Count: 15000 Condition 1 (Invariant): orders.o_orderdate BETWEEN [1994-01-01 00:00:00.000 AND 1995-01-01 00:00:00.000)

Sybase (BID) Inc. Quarter 1 2000 Page 2 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 7 ...... #09: Join (Hash) Left Child Node: #05 Right Child Node: #08 Valid Join Algorithms: MJ, SMJ, HJ, HPDJ, MPDJ Left Input Table 1: supplier Right Input Table 1: region Right Input Table 2: nation Condition 1: (supplier.s_nationkey = nation.n_nationkey 8 ...... #05: Vertical Cursor Table Name: supplier Table Row Count: 100 8 ...... #08: Join (Hash) Left Child Node: #06 Right Child Node: #07 Valid Join Algorithms: MJ, SMJ, HJ, HPDJ, MPDJ Left Input Table 1: nation Right Input Table 1: region Condition 1: (nation.n_regionkey = region.r_regionkey) 9 ...... #06: Vertical Cursor Table Name: nation Table Row Count: 25 9 ...... #07: Vertical Cursor Table Name: region Table Row Count: 5 Condition 1 (Invariant): (region.r_name = 'ASIA') 5 . . . . . #13: Order By Child Node 1: #01 6 ...... #01: Vertical Cursor Table Name: customer Table Row Count: 1500

Sybase (BID) Inc. Quarter 1 2000 Page 3 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans Query Detail (only) for TPCD Query 5 Query Plan: 0 #16: Root Child Node 1: #17 Output Vector:2 entries (47 data bytes) Output 1: nation.n name Output 1 Data Type: CHAR (25, 0) Output 2: (SACast ((SUM ((lineitem.i_extendedprice * (1 – lineitem.l_discount))))) Output 2 Data Type: NUMERIC (35, 4) 1 #17: Scrolling Cursor Store Child Node 1: #15 Output Vector:2 entries (49 data bytes) Output 1: nation.n_name Output 2: SUM( (lineitem.l_extendedprice * (1 - lineitem.l_discount))) 2 . #15: Order By Child Node 1: #14 Ordering Expression 1: SUM((lineitem.l_extendedprice * (1 - lineitem.l_discount))) Ordering Expr. 1 Direction: Descending Output Vector: 2 entries (49 data bytes) Output 1: nation.n_name Output 2: SUM((lineitem.l_ extendedprice * (1 - lineitem.l_discount))) 3 . . #14: Group By (Hash) Child Node 1: #11 Grouping Expression 1: nation.n_name Total cached join plans: 25 Total plan cache hits: 64 Output Vector: 2 entries (49 data bytes) Output 1: nation.n_name Output 2: SUM((lineitem.l_extendedprice * (1 - lineitem.l_discount))) Output 2: Data Type: NUMERIC (35, 4) 4 . . . #11: Join (Sort-Merge) Left Child Node: #12 Right Child Node: #13 Valid Join Algorithms: NLJ, SMJ, HJ, NLPJ Left Input Table 1: customer Right Input Table 1: region Right input Table 2: nation Right input Table 3: supplier Right Input Table 4: lineitem. Right Input Table 5: orders Condition 1: (customer.c_nationkey = supplier.s_nationkey) Condition 2: (customer.ccustkey = orders.o_custkey) Output Vector: 2 entries (45 data bytes) Output 1: nation.n_name Output 2: (lineitem.l_extendedprice * (1 - lineitem.l_discount)) Output 2: Data Type: NUMERIC (25, 4) 5 . . . . #12: Order By Child Node 1: #10 Ordering Expression 1: supplier.s_nationkey Ordering Expression 2: orders.o_custkey Output Vector: 5 entries (49 data bytes) Output 1: nation.n_name Output 2: supplier.s.nationkey Output 3: orders.o_custkey Output 4: lineitem.l_discount Output 5: lineitem.l_extendedprice

Sybase (BID) Inc. Quarter 1 2000 Page 4 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 6 . . . . . #10: Join (Hash PushDowm) Left Child Node: #04 Right Child Node: #09 Valid Join Algorithms: NLJ, SMJ, HJ, HPDJ Left Input Table 1: lineitem Left Input Table 2: orders Right Input Table 1: region Right Input Table 2: nation Right Input Table 3: supplier Condition 1: (lineitem.l_suppkey = supplier.s_suppkey) Condition 2 (Pushed): (lineitem.l_suppkey IN BP(1)) Output Vector: 5 entries (49 data bytes) Output 1: nation.n_name Output 2: supplier.s_nationkey Output 3: orders.o_custkey Output 4: lineitem.l_discount Output 5: lineitem.lextendedprice 7 ...... #04: Join (Hash PushDown) Left Child Node: #02 Right Child Node: #03 Valid Join Algorithms: NIJ, SMJ, HJ, HPDJ, NLPJ Left Input Table 1: lineitem Right Input Table 1: orders Condition 1: (lineitem.l_orderkey = orders.o_orderkey) Condition 2 (Pushed): (lineitem.l_orderkey IN BP(O)) Output Vector: 4 entries (24 data bytes) Output 1: orders.o_custkey Output 2: lineitem.l_discount Output 3: lineitem.l_extendedprice Output 4: lineitem.l_suppkey 8 ...... #02: Vertical Cursor Table Name: lineitem Table Row Count: 60175 Condition 1 (Pushed): (lineitem.l_orderkey IN BP(O)) Condition 1 Selectivity: 0.10893333 Condition 2 (Pushed): (lineitem.l_suppkey IN Bp(l)) Condition 2 Selectivity: 0.20000000 Output Vector: 4 entries (24 data bytes) Output 1: lineitem.l_discount Output 1: Data Type: INT64 (12, 2) Output 1: Base Distincts: 11 Output 2: lineitem.l_extendedprice Output 2: Data Type: INT64 (12, 2) Output 2: Base Distincts (Est.): 1593 Output 3: lineitem.l_suppkey Output 3: Data Type: INTEGER (10, 0) Output 3: Base Distincts: 100 Output 4: lineitem.l_orderkey Output 4: Data Type: INTEGER (10, 0) Output 4: Base Distincts: 15000 Index Output 1 (Projected) lineitem.l_discount Index Output 2 (Projected) lineitem.l_extendedprice Index Output 3 (Projected) lineitem.l_suppkey Index Output 4 (Projected) lineitem.l_orderkey

Sybase (BID) Inc. Quarter 1 2000 Page 5 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 8 ...... #03: Vertical Cursor Table Name: orders Table Row Count: 15000 Condition 1 (Invariant): orders.o_orderdate BETWEEN [1994-01-01 00:00:00.000 AND 1995-01-01 00:00:00.000] Output Vector: 2 entries (8 data bytes) Output 1: orders.o_custkey Output 1: Data Type: INTEGER (10, 0) Output 1: Base Distincts: 1000 Output 2: orders.o_orderkey Output 2: Data Type: INTEGER (10, 0) Output 2: Base Distincts: 15000 Column 1: orders.o_orderdate Column 1: Data Type: TIMESTAMP (23, 0) Column 1: Base Distincts (Est.): 628 Index Output 1 (Projected) orders.o_custkey Index Output 2 (Projected) orders.o_orderkey 7 ...... #09: Join (Hash) Left Child Node: #05 Right Child Node: #08 Valid Join Algorithms: NLJ, SMJ, HJ, HPDJ, NLPJ Left Input Table 1: supplier Right Input Table 1: region Right Input Table 2: nation Condition 1: (supplier.s_nationkey = nation.n_nationkey) Output Vector: 3 entries (33 data bytes) Output 1: nation.n_name Output 2: supplier.snationkey Output 3: supplier.s_suppkey 8 ...... #05: Vertical Cursor Table Name: supplier Table Row Count: 100 Output Vector: 2 entries (8 data bytes) Output 1: supplier.s_nationkey Output 1: Data Type : INTEGER (10,0) Output 1: Base Distincts: 25 Output 2: supplier.s_suppkey Output 2: Data Type: INTEGER (10,0) Output 2: Base Distincts 100 Index Output 1 (Projected) supplier.s_nationkey Index Output 2 (Projected) supplier.s_suppkey 8 ...... #08: Join (Hash) Left Child Node: #06 Right Child Node: #07 Valid Join Algorithms: NW, SMJ, HJ, HIPW, NLPDJ Left Input Table 1: nation Right Input Table 1: region Condition 1 (nation.n_regionkey = region.r_regionkey) Output Vector: 2 entries (29 data bytes) Output 1: nation.n_name Output 2: nation.n_nationkey

Sybase (BID) Inc. Quarter 1 2000 Page 6 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 9 ...... #06: Vertical Cursor Table Name: nation Table Row Count: 25 Output Vector: 3 entries (33 data bytes) Output 1: nation.n_name Output 1: Data Type: CHAR (25, 0) Output 1: Base Distincts: 25 Output 2: nation.n_nationkey Output 2: Data Type : INTEGER (10, 0) Output 2: Base Distincts: 25 Output 3: nation.n_regionkey Output 3: Data Type: INTEGER (10, 0) Output 3: Base Distincts: 5 Index Output 1 (Projected) nation.n_name Index Output 2 (Projected) nation.n_nationkey Index Output 3 (Projected) nation.n_regionkey 9 ...... #07: Vertical Cursor Table Name: region Table Row Count: 5 Condition 1 (Invariant): (region.r_name = ‘ASIA’) Condition 1 Selectivity: 0.20000000 Output Vector: 1 entries (4 data bytes) Output 1: region.r_regionkey Output 1: Data Type: INTEGER (10,0) Output 1: Base Distincts: 5 Column 1: region.r_name Column 1: Data Type: CHAR (25,0) Column 1: Base Distincts: 5 Index Output 1 (Projected) region.r_regionkey 5 . . . . #13: Order By Child Node 1: #01 Ordering Expression 1: customer.c_nationkey Ordering Expression 2: customer.c_custkey Output Vector: 2 entries (8 data bytes) Output 1: customer.c_nationkey Output 2: customer.c_custkey 6 . . . . . #01: Vertical Cursor Table Name: customer Table Row Count: 1500 Output Vector: 2 entries (8 data bytes) Output 1: customer.c_nationkey Output 1: Data Type: INTEGER (10,0) Output 1: Base Distincts: 25 Output 2: customer.c_custkey Output 2: Data Type: INTEGER (10,0) Output 2: Base Distincts: 1500 Index Output 1 (Projected) cstomer.c_nationkey Index Output 2 (Projected) customer.c_custkey

Sybase (BID) Inc. Quarter 1 2000 Page 7 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans Query Plan and SecureStats for TPCD Query 5 Query Plan: 1 #17: Scrolling Cursor Store Child Node 1: #15 Estimated Result Rows: 25 2 . #15: Order By Child Node 1: #14 Estimated Result Rows: 25 3 . . #14: Group By (Hash) Child Node 1: #11 Total cached join plans: 25 Total plan cache hits: 64 Estimated Result Rows: 25 Optimizer Est. Output Width: 49 data bytes 4 . . . #11: Join (Sort-Merge) Left Child Node: #12 Right Child Node: #13 Valid Join Algorithms: NLJ, SMJ, HJ, NLPDJ Left Input Table 1: customer Estimated Left Inputs: 1500 Right Input Table 1: region Right Input Table 2: nation Right Input Table 3: supplier Right Input Table 4: lineitem Right Input Table 5: orders Estimated Right Inputs: 1312 Estimated Join Cost: 25614.51834787 Condition 1: (customer.c_nationkey = supplier.s_nationkey) Condition 1 Selectivity: 0.10000000 Condition 2: (customer.c_custkey = orders.o_custkey) Condition 2 Selectivity: 0.10000000 Optimized for primary key by swapping inputs Estimated Result Rows: 277 Optimizer Est. Output Width: 41 data bytes 5 . . . . #12: Order By Child Node 1: #10 Estimated Result Rows: 1312 6 . . . . . #10: Join (Hash PushDown) Left Child Node: #04 Right Child Node: #09 Valid Join Algorithms: NLJ, SMJ, HJ, HPI)J Left Input Table 1: lineitem Left Input Table 2: orders Estimated Left Inputs: 6556 Right Input Table 1: region Right Input Table 2: nation Right Input Table 3: supplier Estimated Right Inputs: 20 Estimated Join Cost: 24113.51834787 Condition 1: (lineitem.l_suppkey = supplier.s_suppkey) Condition 1 Selectivity: 0.10000000 Condition 2 (Pushed): (lineitem.l_suppkey IN BP(1,supplier.s_suppkey)) Condition 2 Selectivity: 0.20000000 Estimated Result Rows: 1312 Optimizer Est. Output Width: 53 data bytes

Sybase (BID) Inc. Quarter 1 2000 Page 8 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 7 ...... #04: Join (Hash PushDown) Left Child Node: #02 Right Child Node: #03 Valid Join Algorithms: MJ, SMJ, HJ, HPDJ, NLPDJ Left Input Table 1: lineitem Estimated Left Inputs: 60175 Right Input Table 1: orders Estimated Right Inputs: 1634 Estimated Join Cost: 23976.18076250 Condition 1: (lineitem.l_orderkey = orders.o_orderkey) Condition 1 Selectivity: 0.10000000 Condition 2 (Pushed): (lineitem.l_orderkey IN BP(O,orders.o_orderkey)) Condition 2 Selectivity: 0.10893333 Estimated Result Rows: 6556 Optimizer Est. Output Width: 24 data bytes 8 ...... #02: Vertical Cursor Table Name: lineitem Table Row Count: 60175 Condition 1 (Pushed): (lineitem.lorderkey IN BP(O,order:.o_orderkey)) Condition 2 (Pushed): (lineitem.l_suppkey IN BP(1, supplier.s_suppkey Estimated Result Rows: 60175 Optimizer Est. Output Width: 24 data bytes 8 ...... #03: Vertical Cursor Table Name: orders Table Row Count: 15000 Condition 1 (Invariant): orders.o_orderdate BETWEEN [1994-01-01 00:00:000 AND 1995-01-01 00:00:00.000) Condition 1 Selectivity: 0.25000000 Estimated Result Rows: 1634 Optimizer Est. Output Width: 8 data bytes 7 ...... #09: Join (Hash) Left Child Node: #05 Right Child Node: #08 Valid Join Algorithms: MJ, SMJ, HJ, HPW, NLPW Left Input Table 1: supplier Estimated Left Inputs: 100 Right Input Table 1: region Right Input Table 2: nation Estimated Right Inputs: 5 Estimated Join Cost: 136.33758537 Condition 1: (supplier.s_nationkey = nation.n_nationkey) Condition 1 Selectivity: 0.10000000 Estimated Result Row 20 Optimizer Est. Output Width: 37 data bytes 8 ...... #05: Vertical Cursor Table Name: supplier Table Row Count: 100 Estimated Result Rows: 100 Optimizer Est. Output Width: 8 data bytes

Sybase (BID) Inc. Quarter 1 2000 Page 9 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 8 ...... #08: Join (Hash) Left Child Node: #06 Right Child Node: #07 Valid Join Algorithms: NLJ, SMJ, HJ, HPDJ, NLP1)J Left Input Table 1: nation Estimated Left Inputs: 25 Right Input Table 1: region Estimated Right Inputs: 1 Estimated Join Cost: 31.17309472 Condition 1: (nation. n_regionkey = region.r_regionkey) Condition 1 Selectivity: 0.10000000 Estimated Result Rows: 5 Optimizer Est. Output Width: 29 data bytes 9 ...... #06: Vertical Cursor Table Name: nation Table Row Count: 25 Estimated Result Rows: 25 Optimizer Est. Output Width: 33 data bytes 9 ...... #07: Vertical Cursor Table Name: region Table Row Count: 5 Condition 1 (Invariant): (region.r_name = 'ASIA') Estimated Result Rows: 1 Optimizer Est. Output Width: 4 data bytes 5 . . . . #13: Order By Child Node 1: #01 Estimated Result Rows: 1500 6 . . . . . #01: Vertical Cursor Table Name: customer Table Row Count: 1500 Estimated Result Rows: 1500 Optimizer Est. Output Width: 8 data bytes

Sybase (BID) Inc. Quarter 1 2000 Page 10 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans Query Plan, Details and SecureStats for TPCD Query 5 Query Plan: 0 #16: Root Child Node 1: #17 Estimated Result Rows: 25 Production 1: (SACast ((SUM((lineitem.l_extendedprice * (1 - lineitem.l_discount)))) Output Vector: 2 entries (47 data bytes) Output 1: nation.n_name Output 1: Data Type: CHAR (25, 0) Output 2: (SACast ((SUM((lineitem.l_extendedprice * (1 - lineitem.l_discount)))) Output 2: Data Type: NUMERIC (35, 4) 1 #17: Scrolling Cursor Store Child Node 1: #15 Estimated Result Rows: 25 Output Vector: 2 entries (49 data bytes) Output 1: nation.n_name Output 2: SUM((lineitem.l_extendedprice * (1 - lineitem.l_discount))) 2 . #15: Order By Child Node 1: #14 Ordering Expression 1: SUM((lineitem.l_extendedprice * (1 - lineitem.l_discount))) Ordering Expr. 1 Value: May be NULL Ordering Expr. 1 Direction: Descending Non-Key Data 1: nation.n name Non-Key Data 1 Value: Will never be NULL Estimated Result Rows: 25 Output Vector: 2 entries (49 data bytes) Output 1: nation.n_name Output 2: SUM((lineitem.l_extendedprice * (1 - lineitem.l_discount))) 3 . . #14: Group By (Hash) Child Node 1: #11 Grouping Expression 1: nation.n_name Aggregate Expression 1: SUM((lineitem.l_extendedprice * (1 - lineitem.l_discount))) Total cached join plans: 25 Total plan cache hits: 64 Estimated Result Rows: 25 Optimizer Est. Output Width: 49 data bytes Output Vector: 2 entries (49 data bytes) Output 1: nation.n_name Output 2: SUM((lineitem.l_extendedprice * (1 - lineitem.l_discount))) Output 2 Data Type: NUMERIC (35, 4)

Sybase (BID) Inc. Quarter 1 2000 Page 11 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 4 . . . #11: Join (Sort_Merge) Left Child Node: #12 Right Child Node: #13 Valid Join Algorithms:NLJ, SMJ, HJ, NLPDJ Left Input Table 1: customer Estimated Left Inputs: 1500 Right Input Table 1: region Right Input Table 2: nation Right Input Table 3: supplier Right Input Table 4: lineitem Right Input Table 5: orders Estimated Right Inputs: 1312 Estimated Join Cost: 25614.51834787 Condition 1: (customer.c nationkey supplier.s_nationkey) Condition 1 Selectivity: 0.10000000 Condition 2: (customer.ecustkey = orders.o_custkey) Condition 2 Selectivity: 0.10000000 Optimized for primary key by swapping inputs Join comparator: : Non_null identically typed key Estimated Result Rows: 277 Production 1: (1 - lineitem.l_discount) Production 2: (lineitem.l_extendedprice * (1 - lineitem.l_discount)) Optimizer Est. Output Width: 41 data bytes Output Vector: 2 entries (45 data bytes) Output 1: nation.n_name Output 2: (lineitem.l_extendedprice * (1 - lineitem.l_discount Output 2: Data Type: NUMERIC (25, 4) 5 . . . . #12: order By Child Node 1: #10 Ordering Expression 1: supplier.s_nationkey Ordering Expr. 1 Value: Will never be NULL Ordering Expression 2: orders.o_custkey Ordering Expr. 2 Value: Will never be NULL Non-Key Data 1: nation.n name Non-Key Data 1 Value: Will never be NULL Non-Key Data 2: lineitem.l_discount Non-Key Data 2 Value: Will never be NULL Non-Key Data 3: lineitem.l_extendedprice Non-Key Data 3 Value: Will never be NULL Estimated Result Rows: 1312 Output Vector: 5 entries (49 data bytes) Output 1: nation.n name Output 2: supplier.s_nationkey Output 3: orders.o_custkey Output 4: lineitem.l_discount Output 5: lineitem.l_extendedprice

Sybase (BID) Inc. Quarter 1 2000 Page 12 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 6 . . . . . #10: Join (Hash PushDown) Left Child Node: #04 Right Child Node: #09 Valid Join Algorithms: NLJ, SMJ, HJ, HPDJ Left Input Table 1: lineitem Left Input Table 2: orders Estimated Left Inputs: 6556 Right Input Table 1: region Right Input Table 2: nation Right Input Table 3: supplier Estimated Right Inputs: 20 Estimated Join Cost: 24113.51834787 Condition 1: (lineitem.l_suppkey = supplier.s_suppkey) Condition 1 Selectivity: 0.10000000 Condition 2 (Pushed): (lineitem.l_suppkey IN BP(1,supplier.s_suppkey)) Condition 2 Selectivity: 0.20000000 Hash probe comparator: non-null int key Estimated Result Rows: 1312 Optimizer Est. Output Width: 53 data bytes Output Vector: 5 entries (49 data bytes) Output 1: nation.n name Output 2: supplier.s_nationkey Output 3: orders.o_custkey Output 4: lineitem.l_discount Output 5: lineitem.l_extendedprice 7 ...... #04: Join (Hash PushDown) Left Child Node: #02 Right Child Node: #03 Valid Join Algorithms: NLJ SMJ, HJ, HPDJ, MPDJ Left input Table 1: lineitem Estimated Left Inputs: 60175 Right Input Table 1: orders Estimated Right Inputs: 1634 Estimated Join Cost: 23976.18076250 Condition 1: (lineitem.l_orderkey = orders.o_orderkey) Condition 1 Selectivity: 0.10000000 Condition 2 (Pushed): (lineitem.l_orderkey IN BP(O,orders.o_orderkey)) Condition 2 Selectivity: 0.10893333 Hash probe comparator: non-null int key Estimated Result Rows: 6556 Optimizer Est. Output Width: 24 data bytes Output Vector: 4 entries (24 data bytes) Output 1: orders.o_custkey Output 2: lineitem.l_discount Output 3: lineitem.l_extendedprice Output 4: lineitem.l_suppkey

Sybase (BID) Inc. Quarter 1 2000 Page 13 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 8...... #02: Vertical Cursor Table Name: lineitem Table Row Count: 60175 Condition 1 (Pushed): (lineitem.l_orderkey IN BP(O, orders.o_orderkey)) Condition 1 Selectivity: 0.10893333 Condition 2 (Pushed): (lineitem.1_suppkey IN BP(1, supplier.s_suppkey)) Condition 2 Selectivity: 0.20000000 Estimated Result Rows: 60175 Optimizer Est. Output Width: 24 data bytes Output Vector: 4 entries (24 data bytes) Output 1: lineitem.l_discount Output 1: Data Type: INT64 (12, 2) Output 1: Base Distincts: 11 Output 2: lineitem.l_extendedprice Output 2: Data Type: INT64 (12, 2) Output 2: Base Distincts (Est.): 1593 Output 3: lineitem.l_suppkey Output 3: Data Type: INTEGER (10, 0) Output 3: Base Distincts: 100 Output 4: lineitem.l_orderkey Output 4: Data Type: INTEGER (10, 0) Output 4: Base Distincts: 15000 Index Output 1 (Projected): lineitem.1_discount Index Output 2 (Projected): lineitem.1_extendedprice Index Output 3 (Projected): lineitem.l_suppkey Index Output 4 (Projected): lineitem.l_orderkey 8 ...... #03 Vertical Cursor Table Name: order Table Row Count: 15000 Condition 1 (Invariant) : orders.o_orderdate BETWEEN [1994-01-01 00:00:00.000 AND 1995-01-01 00:00.00.000) Condition 1 Selectivity: 0.25000000 Extimated Result Rows: 1634 Optimizer Est. Output Width: 8 data bytes Output Vector: 2 entries (8 data bytes) Output 1: orders.o_custkey Output 1: Data Type: INTEGER (10, 0) Output 1: Base Distincts: 1000 Output 1: Filtered Distincts: 801 Output 2: orders.o_orderkey Output 2: Data Type: INTEGER (10, 0) Output 2: Base Distincts: 15000 Output 2: Filtered Distincts: 1634 Column 1: orders.o_orderdate Column 1: Data Type: TIMESTAMP (23, 0) Column 1: Base Distincts (Est.): 628 Column 1: Filtered Distincts: 503 Index Output 1 (Projected) orders.o_custkey Index Output 2 (Projected) orders.o_orderkey

Sybase (BID) Inc. Quarter 1 2000 Page 14 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 7 ...... #09: Join (Hash) Left Child Node: #05 Right Child Node: #08 Valid Join Algorithms: NLJ, SMJ, HJ, HPDJ, NLPDJ Left Input Table 1: supplier Estimated Left Inputs: 100 Right Input Table 1: region Right Input Table 2: nation Estimated Right Inputs: 5 Estimated Join Cost: 136.33758537 Condition 1: (supplier.s_nationkey = nation.n_nationkey) Condition 1 Selectivity: 0.10000000 Hash probe comparator: non-null int key Estimated Result Rows: 20 Optimizer Est. output Width: 37 data bytes Output Vector: 3 entries (33 data bytes) Output 1: nation.n_name Output 2: supplier.s_nationkey Output 3: supplier.s_suppkey 8 ...... #05: Vertical Cursor Table Name: supplier Table Row Count: 100 Estimated Result Rows: 100 Optimizer Est. Output Width: 8 data bytes Output Vector: 2 entries (8 data bytes) Output 1: supplier.s_nationkey Output 1: Data Type: INTEGER (10, 0) Output 1: Base Distincts: 25 Output 2: supplier.s_suppkey Output 2: Data Type: INTEGER (10, 0) Output 2: Base Distincts: 100 Index Output 1 (Projected) supplier.s_nationkey Index Output 2 (Projected) supplier.s_suppkey 8 ...... #08: Join (Hash) Left Child Node: #06 Right Child Node: #07 Valid Join Algorithms: NLJ, SMJ, HJ, HPDJ, NLPDJ Left Input Table 1: nation Estimated Left Inputs: 25 Right Input Table 1: region Estimated Right Inputs: 1 Estimated Join Cost: 31.17309472 Condition 1: (nation. n_regionkey = region.r_regionkey) Condition 1 Selectivity: 0.10000000 Hash probe comparator: non-null int key Estimated Result Rows: 5 Optimizer Est. Output Width: 29 data bytes Output Vector: 2 entries (29 data bytes) Output 1: nation.n_name Output 2: nation.n_nationkey

Sybase (BID) Inc. Quarter 1 2000 Page 15 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 9 ...... #06 : Vertical Cursor Table Name : nation Table Row Count: 25 Estimated Result Rows: 25 Optimizer Est. Output Width: 33 data bytes Output Vector: 3 entries (33 data bytes) Output 1: nation.n_name Output 1: Data Type: CHAR (25, 0) Output 1: Base Distincts: 25 Output 2: nation.n_nationkey Output 2: Data Type: INTEGER (10, 0) Output 2: Base Distincts: 25 Output 3: nation.n_regionkey Output 3: Data Type: INTEGER (10, 0) Output 3: Base Distincts: 5 Index Output 1 (Projected) nation.n_name Index Output 2 (Projected) nation.n_nationkey Index Output 3 (Projected) nation.n_regionkey 9 ...... #07: Vertical Cursor Table Name: region Table Row Count: 5 Condition 1 (Invariant): (region.r_name = 'ASIA') Condition 1 Selectivity: 0.20000000 Estimated Result Rows: 1 Optimizer Est. Output Width: 4 data bytes Output Vector: 1 entries (4 data bytes) Output 1: region.r_regionkey Output 1: Data Type: INTEGER (10, 0) Output 1: Base Distincts: 5 Output 1: Filtered Distincts: 1 Column 1: region.rname Column 1: Data Type: CHAR (25, 0) Column 1: Base Distincts: 5 Column 1: Filtered Distincts: 1 Index Output 1 (Projected) region.r_regionkey 5 . . . . #13: Order By Child Node 1: #01 Ordering Expression 1: customer.c nationkey Ordering Expr. 1 Value: Will never be NULL Ordering Expression 2: customer.c_custkey Ordering Expr. 2 Value: Will never be NULL Estimated Result Rows: 1500 Output Vector: 2 entries (8 data bytes) Output 1: customer.c nationkey Output 2: customer.ccustkey

Sybase (BID) Inc. Quarter 1 2000 Page 16 Richard Soundy ASIQ12 Performance and Tuning:- Optimiser Plans 6 . . . . . #01: Vertical Cursor Table Name: customer Table Row Count: 1500 Estimated Result Rows: 1500 Optimizer Est. Output Width: 8 data bytes Output Vector: 2 entries (8 data bytes) Output 1: customer.c_nationkey Output 1: Data Type: INTEGER (10, 0) Output 1: Base Distincts: 25 Output 2: customer.c_custkey Output 2: Data Type: INTEGER (10, 0) Output 2: Base Distincts: 1500 Index Output 1 (Projected) customer.c_nationkey Index Output 2 (Projected) customer.c_custkey

Sybase (BID) Inc. Quarter 1 2000 Page 17 Richard Soundy

Recommended publications