SQL Server : are there any side effects to using a

2019-09-12 04:53发布

问题:

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?

回答1:

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.
  • 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.

Your case is somewhere between.