PAGEIOLATCH_SH: Occurswhen a task is waiting on a latch for a buffer that is in an I/Orequest. The latch request is in Shared mode. PAGEIOLATCH_SH waits isvery brief as they are only held on a page during IO operations.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
You can also identify I/O bottlenecks by examining the latch waits.These latch waits account for the physical I/O waits when a page isaccessed for reading or writing and the page is not available in thebuffer pool. When the page is not found in the buffer pool, anasynchronous I/O is posted and then the status of the I/O is checked.If I/O has already completed, the worker proceeds normally. Otherwise,it waits on PAGEIOLATCH_EX or PAGEIOLATCH_SH, depending upon the typeof request. The following DMV query can be used to find I/O latch waitstatistics.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
Select  wait_type,  â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
        waiting_tasks_count,  â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
        wait_time_ms â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
from    sys.dm_os_wait_stats  â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
where    wait_type like 'PAGEIOLATCH%'  â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
order by wait_type â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
More detail information on performance probblems in SQL Server 2005, please navigate to the following article.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
Troubleshooting Performance Problems in SQL Server 2005â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
http://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspxâ­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
                        â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
                                                                                posted @ 2008-03-20 11:46 Rickie 阅读(34) | 评论 (0) | 编辑                        â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
                                â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
                                        2008年3月18日                          #â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
                                                                        SQL Server 2005: Wait Type - CXPACKET                        â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
                                                                                Wait type - CXPACKET â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
Itmeans SQL Query is involved in parallel query execution. This waittypeindicates that the SPID is waiting on a parallel process to complete orstart.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
CXPACKET: Occurs when trying to synchronize the queryprocessor exchange iterator. You may consider lowering the degree ofparallelism if contention on this wait type becomes a problem. â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
******â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
How to configure cost threshold for parallelism Optionâ­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
Use the cost threshold for parallelism option to specifythe threshold at which Microsoft SQL Server creates and runs parallelplans for queries. SQL Server creates and runs a parallel plan for aquery only when the estimated cost to run a serial plan for the samequery is higher than the value set in cost threshold for parallelism.The cost refers to an estimated elapsed time in seconds required to runthe serial plan on a specific hardware configuration. Only set cost threshold for parallelism on symmetric multiprocessors.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
Longer queries usually benefit from parallel plans; the performanceadvantage negates the additional time required to initialize,synchronize, and terminate parallel plans. The cost threshold for parallelism optionis actively used when a mix of short and longer queries is run. Theshort queries run serial plans, whereas the longer queries use parallelplans. The value of cost threshold for parallelism determines which queries are considered short, and they should therefore be run using serial plans.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
In certain cases, a parallel plan may be chosen even though the query's cost plan is less than the current cost threshold for parallelismvalue. This can happen because the decision to use a parallel or serialplan is based on a cost estimate provided before the full optimizationis complete.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
The cost threshold for parallelism option can be set to any value from 0 through 32767. The default value is 5.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
SQL Server ignores the cost threshold for parallelism value under the following conditions:â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
  • Your computer has only one processor.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
  • Only a single CPU is available to SQL Server because of the affinity mask configuration option.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
  • The max degree of parallelismoption is set to 1.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
The cost threshold for parallelism option is an advanced option. If you are using the sp_configure system stored procedure to change the setting, you can change cost threshold for parallelism only when show advanced options is set to 1. The setting takes effect immediately (without a server restart).â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
The following example sets the cost threshold for parallelism to 10 seconds.â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
sp_configure 'show advanced options', 1; â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
GO â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
reconfigure; â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
GO â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
sp_configure 'cost threshold for parallelism', 10; â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
GO â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
reconfigure; â­N|6F0­Fwww.netcsharp.cn–ÊËlcm7
GOâ­N|6F0­Fwww.netcsharp.cn–ÊËlcm7