sql server top 10 IO性能查询
2017-11-28 17:30
260 查看
use master go select top 10 substring(qt.text,(qs.statement_start_offset/2)+1, ((case qs.statement_end_offset when -1 then datalength(qt.text) else qs.statement_end_offset end -qs.statement_start_offset)/2)+1) ,database_name=db.name ,qs.execution_count ,qs.total_logical_reads ,logical_reads_per_run=cast(qs.total_logical_reads*1.0/qs.execution_count as decimal(12,2)) ,qs.last_logical_reads ,qs.total_logical_writes ,qs.last_logical_writes ,qs.total_worker_time ,qs.last_worker_time ,total_elapsed_time_in_s=qs.total_elapsed_time*1.0/1000000 ,last_elapsed_time_in_s=qs.last_elapsed_time*1.0/1000000 ,qs.last_execution_time ,qp.query_plan from sys.dm_exec_query_stats qs cross apply sys.dm_exec_sql_text(qs.sql_handle) qt cross apply sys.dm_exec_query_plan(qs.plan_handle) qp inner join sys.databases as db on qp.dbid=db.database_id --where qs.execution_count>=100 --order by qs.total_logical_reads/qs.execution_count desc --logical reads per run --order by qs.total_logical_writes/qs.execution_count desc --logical writes per run --order by qs.total_worker_time/qs.execution_count desc --cpu time per run --order by qs.total_logical_reads desc --logical reads --order by qs.total_logical_writes desc --logical writes order by qs.total_worker_time desc --cpu time
View Code
相关文章推荐
- SET STATISTICS IO和SET STATISTICS TIME 在SQL Server查询性能优化中的作用
- 利用SET STATISTICS IO和SET STATISTICS TIME 优化SQL Server查询性能
- 利用SET STATISTICS IO和SET STATISTICS TIME 优化SQL Server查询性能
- 利用SET STATISTICS IO和SET STATISTICS TIME 优化SQL Server查询性能
- SQL Server 常用的 SHOWPLAN_ALL 和 STATISTICS IO 分析索引和查询性能
- SET STATISTICS IO和SET STATISTICS TIME 在SQL Server查询性能优化中的作用
- SQL Server创建复合索引时,复合索引列顺序对查询的性能影响
- SQL Server 2005分页查询性能优化
- SQL Server 查询性能优化——索引与SARG(一)
- 关联查询中使用TOP引起的性能问题分析
- SQL Server 查询性能优化——创建索引原则(二)
- Sql Server性能优化辅助指标SET STATISTICS TIME ON和SET STATISTICS IO ON
- 如何找出你性能最差的SQL Server查询
- Sql Server查询性能优化之走出索引的误区
- SQL Server 性能调优前10步骤
- 优化 SQL Server 查询性能
- SQL Server 查询性能优化——覆盖索引(一)
- Sql server 2008查询性能优化学习笔记一
- 记一次sql server 性能调优,查询从20秒至2秒
- 优化 SQL Server 查询性能