‘A’ = N’A’ , will not kill index seek in sqlserver version above 2014 anymore
Thanks to

The advisor show us that we can get different behavior when we use condition , ='20000' or N'20000'
CODE
/*+++++++++++++++++*/
set nocount on
go
create table dbo.Data
(
Id int not null identity(1,1),
VarcharColumn varchar(10) not null,
Placeholder char(200) null
constraint DEF_Data_Placeholder
default 'The placeholder',
constraint PK_Data
primary key clustered(ID)
)
go
declare
@I int
select @I = 0
begin tran
while @I < 50000
begin
insert into dbo.Data(VarcharColumn)
values(convert(varchar(10),@I))
select @I += 1
end
commit
go
create unique nonclustered index IDX_Data_VarcharColumn
on dbo.Data(VarcharColumn)
go
/*+++++++++++++++++*/
In his article, He means


However, as my site enviroument ,
Microsoft SQL Server 2014 - 12.0.2000.8 (X64) Enterprise Edition (64-bit) on Windows NT 6.1
I get an different result

and

Maybe in sqlserver new version . the SQL engine enhanced.
‘A’ = N’A’ , will not kill index seek in sqlserver version above 2014 anymore的更多相关文章
- Index Seek和Index Scan的区别
Index Seek是Sql Server执行查询语句时利用建立的索引进行查找,索引是B树结构,Sql Server先查找索引树的根节点,一级一级向下查找,在查找到相应叶子节点后,取出叶子节点的数据. ...
- SqlSever中Index Seek的匹配规则(一)
我们知道在SqlServer中,索引对查询语句的优化起着巨大的作用,一般来说在执行计划中出现了Index Seek的步骤,我们就认为索引命中了.但是Index Seek中有两个部分是值得我们注意的,我 ...
- index seek与index scan
原文地址:http://blog.csdn.net/pumaadamsjack/article/details/6597357 低效Index Scan(索引扫描):就全扫描索引(包括根页,中间页和叶 ...
- SQL Server中LIKE %search_string% 走索引查找(Index Seek)浅析
在SQL Server的SQL优化过程中,如果遇到WHERE条件中包含LIKE '%search_string%'是一件非常头痛的事情.这种情况下,一般要修改业务逻辑或改写SQL才能解决SQL执行 ...
- Sql Server中的表访问方式Table Scan, Index Scan, Index Seek
1.oracle中的表访问方式 在oracle中有表访问方式的说法,访问表中的数据主要通过三种方式进行访问: 全表扫描(full table scan),直接访问数据页,查找满足条件的数据 通过row ...
- 转:Sql Server中的表访问方式Table Scan, Index Scan, Index Seek
0.参考文献 Table Scan, Index Scan, Index Seek SQL SERVER – Index Seek vs. Index Scan – Diffefence and Us ...
- index seek和index scan 提高sql 效率
index seek和index scan 提高sql 效率解释解释index seek和index scan:索引是一颗B树,index seek是查找从B树的根节点开始,一级一级找到目标行.ind ...
- Clustered Index Scan 与 Clustered Index Seek
Clustered Index Scan 与 Clustered Index Seek 在利用 SQL Server 查询分析器的执行计划中,会有许多扫描方式,其中就有 Clustered Index ...
- SqlServer中Index Seek的匹配规则(一)
我们知道在SqlServer中,索引对查询语句的优化起着巨大的作用,一般来说在执行计划中出现了Index Seek的步骤,我们就认为索引命中了.但是Index Seek中有两个部分是值得我们注意的,我 ...
随机推荐
- webpack初学踩坑记
注意事项: 1. webpack不用装在全局环境下,在哪个项目中使用,就安装在该项目下即可 1. 问题一:npm init 初始化一个项目后,添加webpack.config.js文件,在该项目中通过 ...
- css积累
1. 图片底部3像素的问题解决方案 display: inline-block; vertical-align: bottom;
- dfs序与求子树子节点(染了色)的个数
https://blog.csdn.net/hpu2022/article/details/81910490 https://blog.csdn.net/qq_39670434/article/det ...
- java知识树
https://blog.csdn.net/aitaozi11/article/details/79652943 (学习Java的9张思维导图) 文章目录 针对技术栈学习 1. java基础 1.1 ...
- 1、json背景
教程链接 链接:http://pan.baidu.com/s/1mil4M1M 密码:vwsn JSON (JavaScript对象表示法)是一种轻量级的基于文本的开放标准,被设计用于可读的数据交换, ...
- wordpress 支持上传中文名称文件
添加文章难免要传个图.文件啥的,可是呢,上传中文名称的文件竟然不行,找了半天,中文乱码,脑残了,竟然忘了这个事,哎 修改其实很简单,只需要两步 1./wp-admin/includes/file.ph ...
- linux下使用crontab新建定时任务
我安装了一个全文搜索的插件,但是需要生成索引才能使用,但是不能手动生成索引,所以说呢,我就加了一个定时任务, 一.首先vim /etc/crontab 打开文件 我根据上面的提示加了用户名,但是看到其 ...
- Android学习02
今天学了ScrollView&HorizontalScrollView和WebView 一.ScrollView(垂直滚动),HorizontalScrollView(水平滚动) Scroll ...
- 忘记SYS密码
进入控制台录入 sqlplus /nolog; connect / as sysdba alter user sys identified by ; alter user system ident ...
- python 编程的 Style Guide
Python 的作者既优雅又高冷又 鬼毛的 再 PEP8 里规定了 Python 程序编写规范.(风格和格式) 一.基本观念 1.可读性之上,代码被读的次数肯定比被写的次数多.因此作者十分重视代码的可 ...