SQL Server Technical Bulletin - The Index Tuning Wizard (832526)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions)
ResolutionAfter the query created the two indexes that were recommended in the
Index Tuning Wizard, the query ran in 2 seconds, and the query generated the following
execution plan: Note Some sections of the query execution plan have been removed for
readability purposes. |--Compute Scalar(DEFINE:([Expr1003]=Convert([Expr1004])))
|--Stream Aggregate(GROUP BY:([a].[IMAGE_RECEIVED_DTTM], [a].[STATUS_CD]) DEFINE:([Expr1004]=Count(*)))
|--Sort(ORDER BY:([a].[IMAGE_RECEIVED_DTTM] ASC, [a].[STATUS_CD] ASC))
|--Nested Loops(Inner Join)
|--Clustered Index Seek(OBJECT:([mydb].[dbo].[WORK_QUE].[PK_WORK_QUE] AS [C]), |--Nested
Loops(Inner Join, OUTER REFERENCES:([b].[STATUS_CD]) WITH PREFETCH)
|--Clustered Index
Scan(OBJECT:([mydb].[dbo].[STATUS_TYPES].[PK__STATUS_TYPES__4D94879B] AS [b]),
|--Index Seek(OBJECT:([mydb].[dbo].[IMAGES_DETAIL].[IMAGES_DETAIL16] AS [a]),
This execution plan shows that
the index that the ITW recommended on the images_detail
table made only one Index Seek operation necessary on that table. In the "Identification" section, you can see that the index that was used for the images_detail
table made two Index Scans and one Index Seek necessary. Therefore, the addition of the index that was recommended by ITW turns the query into a covered query for the images_detail table. This increases the performance of the query. In a covered query, all the columns specified in the query are
contained in one index. Also, the recommended clustered
index on the wrk_que table made the Bookmark Lookup operation unnecessary. When the query ran in about 10 to 15 minutes, an Index Seek operation was performed
on the non-clustered index on the wrkque_cd column of the wrk_que table. After
this Index Seek operation was completed, the Bookmark Lookup operation was used to retrieve the corresponding
row from the table. After the 2 indexes were added, the query ran in 2 seconds, and a Clustered Index Seek operation was performed on the new clustered index on the
wrkque_cd column of the wrk_que table. (The old non-clustered index was
dropped.) This Clustered Index Seek operation made the Bookmark Lookup operation unnecessary
because the Clustered Index Seek operation provided the corresponding row from the table. A Bookmark Lookup operation is used to retrieve data from a table. If the table has no clustered index, the row ID is used to retrieve the row from the table. If you eliminate a Bookmark Lookup operation, you may notice some performance improvement. Performance improves because fewer disk reads may be required and because the table does not have to be navigated to retrieve a row. Instead, the particular index that is stored in memory can be used to retrieve the row from the table. The particular index is stored in memory because of its size. Using the Index Tuning Wizard to help tune a particular workload is very important. Many cases have been solved by using the Index Tuning Wizard. Note
Because the Index Tuning Wizard does not execute any batch of queries in the workload during analysis, the wizard cannot provide recommendations for a batch that references temporary objects.
back to the topback to the topback to the top
Modification Type: | Minor | Last Reviewed: | 11/10/2004 |
---|
Keywords: | kbTypeNonKB kbPubTypeTT kbscan kbQuery kbPerformance kbwizard kbServer kbDatabase kbinfo KB832526 kbAudDeveloper |
---|
|
|
©2004 Microsoft Corporation. All rights reserved.
|
|