AXISHK
asked on
Top Query for IO usage on SQL Server
How to list out the top 10 queries for physical IO usage and shows its queyr plan on SQL 2008 ?
Tks
Tks
ASKER
Tks.
For performance study, which way should I review, CPU (worst CPU) , I/O (long wait IO).. ?
For performance study, which way should I review, CPU (worst CPU) , I/O (long wait IO).. ?
It depends on what the query is doing, and you also have to take into account what other workloads may be running on the server at the same time.
You really need to be looking at those numbers in tandem with a specific query plan to be able to identify any potential areas for improvement.
High CPU could indicate an excessive load on the server in general, or it could represent excessive calculations, or function calls, within the query itself.
Same for IO. It could be high because of a bottleneck in the disk controller, or it could be caused by excessive reads due to a lack of RAM (causing excessive paging).
The query plan itself should indicate which area is likely to be the problem. You can then use the values from the DMV to gauge if any changes you make actually improve anything.
You really need to be looking at those numbers in tandem with a specific query plan to be able to identify any potential areas for improvement.
High CPU could indicate an excessive load on the server in general, or it could represent excessive calculations, or function calls, within the query itself.
Same for IO. It could be high because of a bottleneck in the disk controller, or it could be caused by excessive reads due to a lack of RAM (causing excessive paging).
The query plan itself should indicate which area is likely to be the problem. You can then use the values from the DMV to gauge if any changes you make actually improve anything.
ASKER
For your query, what's the different between total_physical_reads & total_logical_reads ? What's the execution_count ?
Tks
Tks
Physical reads is the number of pages that had to be read from disk into memory prior to querying. Logical reads is the number of pages that were already in cache, and therefore didn't need to be read from disk.
Execution_count is the number of times the query has been executed since the server was last restarted.
Execution_count is the number of times the query has been executed since the server was last restarted.
ASKER
Tks. Is there a way to clean up these data in the morning without reboot the server such that I can retrieve the value for a day ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
Bear in mind that if the table is cached, then physical reads will be 0.