如何检查查询是否使用索引 [英] how to check the query is using index

查看:191
本文介绍了如何检查查询是否使用索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SQL Server,我没有足够的数据集来测试查询的性能。

I am using SQL Server and I don't have enough dataset to test the performance of the query.

我想分析查询,看看索引是否被利用。如何检查

I want to analyze query and see if the index were utilize or not. How can I check that

推荐答案

在SQL Management Studio中,只需输入查询,并按Control-L计划)。在那里,您将能够看到是否正在使用任何索引。 表扫描表示不使用索引。 索引扫描表示使用索引。

In SQL Management Studio, just type in the query, and hit Control-L (display query execution plan). There, you will be able to see whether any indexes are being used. A "table scan" means the index is not used. An "index scan" means the index is used.

这篇关于如何检查查询是否使用索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆