简体   繁体   English

SQL Server:使用过滤索引是否有副作用?

[英]SQL Server : are there any side effects to using a filtered index?

Are there any inherit side effects when using a filtered index? 使用过滤索引时是否有任何继承副作用? Eg 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 - 让我们看一下边缘情况-

  • If all the records pass the filter then we have wasted CPU for nothing. 如果所有记录都通过了过滤器,那么我们就白白浪费了CPU。
  • If None of the records pass the filter than we invested some CPU filtering out records but we saved CPU, IO and memory for all the inserts we didn't do. 如果没有一个记录通过过滤器,那么我们将投入一些CPU过滤掉记录,但是我们为所有未执行的插入操作节省了CPU,IO和内存。

Your case is somewhere between. 您的情况介于两者之间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM