Technology of SQL Server database (53)
Tuesday, March 03, 2009 by rain
8.5.1 index and systematic performance
The rate that index can accelerate data retrieval,But it can make the insertion of data, delete and slow newlier.Form a cluster especially index,Data is according to logic order is deposited in proper physical place,When altering data,According to new data order,The shift that needs to have a lot of data physical place,The burden that this will add a system.To be not bunch to index,When data is updated, also need to update index page,This also needs to take up systematic time.Use too much index in a watch accordingly,The performance that can affect a database.To a table that changes via regular meeting,Should restrict a watch to use to bunch indexes and do not exceed 3~4 only as far as possible the index that be not bunch.To the watch with clerical particularly heavy processing,Its index should not exceed 3 as far as possible.
8.5.2 index adjusts guide (Index Tuning Wizard)
The index that index adjusts guide to the help chooses and can found an optimization assembles,In order to improve the performance of the database.
Should use index to adjust guide to need a working load to record (Workload) .The memory that working load record founds by SQL script or SQL Server Profiler dogs mediumly in file or watch composition.If do not have the working load that is aimed at the database that should undertake indexing adjustment or watch existently,record,Can found through SQL Server Profiler (its are specific the usage that the method refers to the SQL Server Profiler in chapter of 19 please) .Can dog to the definition will found or build to dog with TSQL of - of Sample 1.Index adjusts guide to be able to use inquiry to optimize implement according to the function that analysis of working load record indexes,Put forward corresponding adjustment to suggest.Can allow a system instantly according to suggesting to revise index,After also can including a plan the job, found again.
8.5.3 uses index to adjust guide:
Use index adjusts the measure of guide to be as follows
(1) from " Tools " choose in menu " Wizards " option,The choice guide interface that if place of graph 8-15 is shown,appears.
(2) choose from inside tree catalog " Management " below " Index Tuning Wizard " option,The index that if place of graph 8-16 is shown,appears adjusts guide interface.
(3) click " next " pushbutton,The choice server that if place of graph 8-17 is shown,appears and database dialog box.The database that here the choice should undertake indexing adjustment.Each option meaning is as follows:
Keep All Existing Indexes
The index that reservation has existed.If do not choose this option,Will delete a few reference possibly when undertaking indexing optimizing.
Perform Thorough Analysis
To working load the record undertakes be analyticed thoroughly.
(4) click " next " pushbutton,Appear to appoint working load to record file dialog box like what place of graph 8-18 shows.The working load that wants the database that undertakes indexing adjustment in this choice records a file.Click " Advanced Options... " pushbutton,The modification default that if place of graph 8-19 is shown,appears adjusts parameter dialog box,Can be examined or revise the parameter that adjusts index to install;The largest number of the row in index,The the largest space that carries supply to recommend index, biggest adjust inquiry to check a number.
(5) click " next " pushbutton,The watch dialog box that the designation that if place of graph 8-20 is shown,appears has indexing adjustment.The one or more watch in the database that here the choice should undertake indexing adjustment
(6) click " next " pushbutton,Appear to recommend index to adjust a dialog box like what place of graph 8-21 shows,The should have indexing adjustment index that in this choice the system recommends,Include its adjust a plan.
(7) click " next " pushbutton,The end index that if place of graph 8-22 is shown,appears adjusts a dialog box.So far,Index adjusts guide to carry out end.Click " finish " pushbutton ends guide.