Quantcast
Channel: Answers for "Query hitting unexpected index"
Browsing all 6 articles
Browse latest View live

Answer by Grant Fritchey

Without seeing the execution plans, I'm speculating, but... the local variable results in a a sample against the statistics of the column while the sub-query is probably converted to a join and either...

View Article



Answer by Sacred Jewel

It is not recommended to use the local variables. This is where the problem occurs. When you use local variable, the optiizer somehow is trying to work on another_col = '10' and list_number IS NOT NULL...

View Article

Answer by Håkan Winther

In this case I agree with @Sacred Jewel and @rafat. The local variable makes the optimizer to guess the selectivity, on the other hand parameters may cause parameter sniffing. You could take a look at...

View Article

Answer by Grant Fritchey

Without seeing the execution plans, I'm speculating, but... the local variable results in a a sample against the statistics of the column while the sub-query is probably converted to a join and either...

View Article

Answer by Sacred Jewel

It is not recommended to use the local variables. This is where the problem occurs. When you use local variable, the optiizer somehow is trying to work on another_col = '10' and list_number IS NOT NULL...

View Article


Answer by Håkan Winther

In this case I agree with @Sacred Jewel and @rafat. The local variable makes the optimizer to guess the selectivity, on the other hand parameters may cause parameter sniffing. You could take a look at...

View Article
Browsing all 6 articles
Browse latest View live




Latest Images