查询执行计划:缺少索引 [英] query execution plan : missing index

查看:553
本文介绍了查询执行计划:缺少索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

alt text http://img502.imageshack.us/img502/7245/75088152 .jpg

我将两个表连接在一起,其中一个是临时表,我在创建表后创建索引。但是在上面的查询执行计划中说过。

There are two tables that I join them together, one of them is a temp table and I create an index after creating the table. But it is said in the query execution plan above.

我应该考虑将所有扫描操作转换为搜索操作?有些部分是连接和条件......

what should I consider to convert all scan operations to seek operations? There are parts which are joins and where conditions...

关于
bk

Regards bk

推荐答案

显示的缺失索引提示是您的最佳起点。 SQL Server已经检测到你会通过添加它告诉你的索引来获得更好的性能。

The "Missing index" hint that is displayed is your best starting point. SQL Server has detected you would get better performance by adding the index that it tells you to.

很难具体,因为确实需要知道你的SELECT语句是什么许多事情都可能导致扫描而不是搜索。

It's difficult to be specific as really need to know what your SELECT statement is as a number of things could cause a scan to be done instead of seek.

例如,我最近在博客上发表了关于 WHERE子句的结构如何(例如)日期过滤的查询,可以将搜索转化为扫描 - 在这种情况下,需要注意的是在WHERE子句中使用函数。

As an example, I recently blogged about how the structure of your WHERE clause for (e.g.) date filtered queries, can turn seeks into scans - in this instance things to look out for are the use of functions within the WHERE clause.

这篇关于查询执行计划:缺少索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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