性能问题
<p> 12.5.0的查询计划</p><p>QUERY PLAN FOR STATEMENT 1 (at line 1). </p><p></p><p><br/> STEP 1 <br/> The type of query is INSERT. <br/> The update mode is direct. <br/> Worktable2 created for REFORMATTING. </p><p><br/> FROM TABLE <br/> FeeType <br/> ft <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_FEETYPE <br/> Forward scan. <br/> Positioning at start of table. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. <br/> TO TABLE <br/> Worktable2. </p><p><br/> STEP 2 <br/> The type of query is INSERT. <br/> The update mode is direct. <br/> Worktable3 created for REFORMATTING. </p><p><br/> FROM TABLE <br/> VendorFee <br/> vf <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_VENDORFEE <br/> Forward scan. <br/> Positioning at start of table. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. <br/> TO TABLE <br/> Worktable3. </p><p><br/> STEP 3 <br/> The type of query is INSERT. <br/> The update mode is direct. <br/> Worktable1 created for ORDER BY. </p><p><br/> FROM TABLE <br/> OtherFee <br/> o <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_OTHERFEE <br/> Forward scan. <br/> Positioning at start of table. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Vendor <br/> v <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_VENDOR <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> VendorID ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Stores <br/> s <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_STORES <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> StoreID ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Worktable2. <br/> Nested iteration. <br/> Using Clustered Index. <br/> Forward scan. <br/> Positioning by key. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Worktable3. <br/> Nested iteration. <br/> Using Clustered Index. <br/> Forward scan. <br/> Positioning by key. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> UserBuyer <br/> u <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_USERBUYER <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> Buyer ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Buyer <br/> b <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_BUYER <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> Buyer ASC </p><p><br/> Run subquery 1 (at nesting level 1). <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. <br/> TO TABLE <br/> Worktable1. </p><p><br/> STEP 4 <br/> The type of query is SELECT. <br/> This step involves sorting. </p><p><br/> FROM TABLE <br/> Worktable1. <br/> Using GETSORTED <br/> Table Scan. <br/> Forward scan. <br/> Positioning at start of table. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With MRU Buffer Replacement Strategy for data pages. </p><p><br/>NESTING LEVEL 1 SUBQUERIES FOR STATEMENT 1. </p><p><br/> QUERY PLAN FOR SUBQUERY 1 (at nesting level 1 and at line 10). </p><p><br/> Correlated Subquery. <br/> Subquery under an EXPRESSION predicate. </p><p></p><p><br/> STEP 1 <br/> The type of query is SELECT. <br/> Evaluate Ungrouped COUNT AGGREGATE. </p><p><br/> FROM TABLE <br/> ST_Vendor <br/> a <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_ST_VENDOR <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> VendorID ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Stores <br/> b <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_STORES <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> StoreID ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> END OF QUERY PLAN FOR SUBQUERY 1. </p><p></p><p><br/>Server Message: Number 1562, Severity 10<br/>Server 'FYMIS02', Line 1:<br/>The sort for Worktable2 is done in Serial <br/>Server Message: Number 1562, Severity 10<br/>Server 'FYMIS02', Line 1:<br/>The sort for Worktable3 is done in Serial <br/>Server Message: Number 1562, Severity 10<br/>Server 'FYMIS02', Line 1:<br/>The sort for Worktable1 is done in Serial <br/>Table: ST_Vendor scan count 1, logical reads: (regular=7 apf=0 total=7), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Stores scan count 24, logical reads: (regular=51 apf=0 total=51), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: OtherFee scan count 1, logical reads: (regular=73110 apf=0 total=73110), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Vendor scan count 20, logical reads: (regular=60 apf=0 total=60), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: UserBuyer scan count 20, logical reads: (regular=40 apf=0 total=40), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Buyer scan count 760, logical reads: (regular=1520 apf=0 total=1520), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Stores scan count 20, logical reads: (regular=42 apf=0 total=42), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: VendorFee scan count 1, logical reads: (regular=2011 apf=0 total=2011), physical reads: (regular=288 apf=0 total=288), apf IOs used=0 <br/>Table: FeeType scan count 1, logical reads: (regular=6 apf=0 total=6), physical reads: (regular=6 apf=0 total=6), apf IOs used=0 <br/>Table: Worktable1 scan count 0, logical reads: (regular=1050 apf=0 total=1050), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Worktable2 scan count 20, logical reads: (regular=171 apf=0 total=171), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Worktable3 scan count 0, logical reads: (regular=92068 apf=0 total=92068), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Total writes for this command: 2481 <br/>(760 rows affected)<br/></p> <p> 12.5.3的查询计划</p><p>QUERY PLAN FOR STATEMENT 1 (at line 1). </p><p></p><p><br/> STEP 1 <br/> The type of query is INSERT. <br/> The update mode is direct. <br/> Worktable2 created for REFORMATTING. </p><p><br/> FROM TABLE <br/> VendorFee <br/> vf <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_VENDORFEE <br/> Forward scan. <br/> Positioning at start of table. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. <br/> TO TABLE <br/> Worktable2. </p><p><br/> STEP 2 <br/> The type of query is INSERT. <br/> The update mode is direct. <br/> Worktable1 created, in allpages locking mode, for ORDER BY. </p><p><br/> FROM TABLE <br/> OtherFee <br/> o <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_OTHERFEE <br/> Forward scan. <br/> Positioning at start of table. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Vendor <br/> v <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_VENDOR <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> VendorID ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Stores <br/> s <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_STORES <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> StoreID ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> FeeType <br/> ft <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_FEETYPE <br/> Forward scan. <br/> Positioning at start of table. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Worktable2. <br/> Nested iteration. <br/> Using Clustered Index. <br/> Forward scan. <br/> Positioning by key. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> UserBuyer <br/> u <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_USERBUYER <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> Buyer ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Buyer <br/> b <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_BUYER <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> Buyer ASC </p><p><br/> Run subquery 1 (at nesting level 1). <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. <br/> TO TABLE <br/> Worktable1. </p><p><br/> STEP 3 <br/> The type of query is SELECT. <br/> This step involves sorting. </p><p><br/> FROM TABLE <br/> Worktable1. <br/> Using GETSORTED <br/> Table Scan. <br/> Forward scan. <br/> Positioning at start of table. <br/> Using I/O Size 2 Kbytes for data pages. <br/> With MRU Buffer Replacement Strategy for data pages. <br/> STEP 1 </p><p><br/>NESTING LEVEL 1 SUBQUERIES FOR STATEMENT 1. </p><p><br/> QUERY PLAN FOR SUBQUERY 1 (at nesting level 1 and at line 10). </p><p><br/> Correlated Subquery. <br/> Subquery under an EXPRESSION predicate. </p><p></p><p><br/> STEP 1 <br/> The type of query is SELECT. <br/> Evaluate Ungrouped COUNT AGGREGATE. </p><p><br/> FROM TABLE <br/> ST_Vendor <br/> a <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_ST_VENDOR <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> VendorID ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> FROM TABLE <br/> Stores <br/> b <br/> Nested iteration. <br/> Using Clustered Index. <br/> Index : PK_STORES <br/> Forward scan. <br/> Positioning by key. <br/> Keys are: <br/> StoreID ASC <br/> Using I/O Size 2 Kbytes for data pages. <br/> With LRU Buffer Replacement Strategy for data pages. </p><p><br/> END OF QUERY PLAN FOR SUBQUERY 1. </p><p></p><p><br/>Server Message: Number 1562, Severity 10<br/>Server 'FYMIS03', Line 1:<br/>The sort for Worktable2 is done in Serial <br/>Server Message: Number 1562, Severity 10<br/>Server 'FYMIS03', Line 1:<br/>The sort for Worktable1 is done in Serial <br/>Table: ST_Vendor scan count 1, logical reads: (regular=6 apf=0 total=6), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Stores scan count 24, logical reads: (regular=49 apf=0 total=49), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: OtherFee scan count 1, logical reads: (regular=48445 apf=0 total=48445), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Vendor scan count 20, logical reads: (regular=80 apf=0 total=80), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: UserBuyer scan count 20, logical reads: (regular=60 apf=0 total=60), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Buyer scan count 780, logical reads: (regular=1560 apf=0 total=1560), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Stores scan count 20, logical reads: (regular=41 apf=0 total=41), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: VendorFee scan count 1, logical reads: (regular=2003 apf=0 total=2003), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: FeeType scan count 20, logical reads: (regular=60 apf=0 total=60), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Worktable1 scan count 0, logical reads: (regular=1079 apf=0 total=1079), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Table: Worktable2 scan count 0, logical reads: (regular=92833 apf=0 total=92833), physical reads: (regular=0 apf=0 total=0), apf IOs used=0 <br/>Total writes for this command: 2698 <br/>(780 rows affected)<br/></p> 查询计划不一样哟
页:
[1]