SQL optimization:Implicit Conversion will cause index scan instead of index seek.
来源:互联网 发布:网络舆情分析系统 编辑:程序博客网 时间:2024/04/19 03:23
1. Implicit Conversion will cause index scan instead of index seek.
SELECT a
FROM dbo.TeletedAS GP
WHERE principalId =@temp
Note: principalId date type is uniqueidentifier; but the @temp type is nvarchar.
Fix:
way 1: ensure the 2 have same data type.
way 2: we can use explicit conversion.
Note: Not all implicit conversion will lead to index scan instead of index seek.
For more info, you can see the posthttps://www.sqlskills.com/blogs/jonathan/implicit-conversions-that-cause-index-scans/
https://msdn.microsoft.com/en-us/library/ms191530.aspx (Date type conversion)
Why can implicit conversion lead to index scan instead of index seek?
From execution plan, I know sql optimizer try to implicitly convert principalId, not @temp, that is why it only use index scan. (stupid work, right?)
- SQL optimization:Implicit Conversion will cause index scan instead of index seek.
- Index Seek和Index Scan
- index seek与index scan
- index seek与index scan
- index seek与index scan .
- Table Scan, Index Scan, Index Seek
- Table Scan, Index Scan, Index Seek
- Table Scan, Index Scan, Index Seek
- Sql Server中的表访问方式Table Scan, Index Scan, Index Seek
- Sql Server中的表访问方式Table Scan, Index Scan, Index Seek
- Sql Server中的表访问方式Table Scan, Index Scan, Index Seek
- Index Seek和Index Scan的区别以及适用情况
- sql server中clustered index scan,table scan,index scan
- Query Optimization:Scan Seek
- [Index]Index Scan
- Index of sql server
- index range scan,index fast full scan,index skip scan
- index unique scan vs index full scan
- 用js实现鼠标移动文字上变色
- XtraBackup,在使用innobackupex 中出现了错误: perl-DBD-MySQL 无法安装
- 将时间转换成yyyy-MM-dd HH:mm:ss的格式字符串
- 设计编码中常见Bug及应对方法
- WCF 通过web.config配置文件解决传输内容过大问题
- SQL optimization:Implicit Conversion will cause index scan instead of index seek.
- javaweb 中的路径问题
- SpringMVC学习系列 之 国际化
- OpenCV源码阅读(1)---matx.h---mat类与vec类
- java发送http get 和 post 请求
- DIG学习稿
- Strategy模式 策略模式
- 错误解决Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
- Hping3学习稿