SQL Server:使用过滤索引是否有副作用? [英] SQL Server : are there any side effects to using a filtered index?

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

问题描述

使用过滤索引时是否有任何继承的副作用?例如.如果您插入一百万行,那么与拥有未经过滤的相同索引相比,索引将需要更长的时间进行处理等?

Are there any inherit side effects when using a filtered index? E.g. if you insert a million rows, will the index take longer to process etc compared to having the same index that is non-filtered?

推荐答案

始终存在阈值.
让我们看一下边缘情况-

There is always a threshold.
Let's look on the edge case -

  • 如果所有记录都通过了过滤器,那么我们就白白浪费了CPU.
  • 如果没有一个记录通过过滤器,则我们投入了一些CPU来过滤掉记录,但是我们为所有未执行的插入操作节省了CPU,IO和内存.

您的案子介于两者之间.

Your case is somewhere between.

这篇关于SQL Server:使用过滤索引是否有副作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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