Why does the SqlServer optimizer get so confused with parameters?

后端 未结 9 2509
猫巷女王i
猫巷女王i 2020-12-15 12:59

I know this has something to do with parameter sniffing, but I\'m just perplexed at how something like the following example is even possible with a piece of technology that

9条回答
  •  暖寄归人
    2020-12-15 13:18

    Could you check on the SQL Profiler how many reads and execution time when it is quick and when it is slow? It could be related to the number of rows fetched depending on the parameter value. It doesn't sound like a cache plan issue.

提交回复
热议问题