Does SQL Server propagate WHERE conditions in complex views?

后端 未结 3 915
眼角桃花
眼角桃花 2021-01-22 15:37

I\'ve followed this question with a full example in case it isn\'t clear what I mean from the question.

I\'ve made a view which joins data from about five tables. The t

3条回答
  •  灰色年华
    2021-01-22 16:06

    The engine will do whatever it thinks is fastest. If you have that field indexed, and your JOIN keys are all indexed, it may or may not run that filter first.

    It may actually run the filter LAST if the WHERE clause is more expensive (i.e. unindexed) - that way the expensive operation is running on the smallest result set.

    Ther only way to know for sure is to run the query and check the execution plan (ACTUAL not estimated).

提交回复
热议问题