Hi all,
I have a parametrized query, which ran 1sec until we changed MAX DOP from 0 to 1. The change had been recommended by microsoft support due to other issues on this server. The server has 8 cores, 16 with hyperthreading on.
After that, the same query (same parameters, of course) took 33 sec. Ok, seems there is a need to recompile this query, to take the changed parameter into account. So I issued a dbcc freeproccache to enforce a recompile of the query. Unfortunately, this did not solve the problem, still took 33 sec. Just to be sure, I added an option (recompile) to the original query. Now, the same query, same params ran in 500 msec. When I remove the option (recompile), it again takes 33 sec.
I'm confused about this different behaviour. Why doesn't dbcc freeproccache have the same effect? Why is the query back on bad performance just by removing the option (recompile)?
The effect is only reproducible using a parametrized query, it does not occur when issuing the same query with parameters replaced by constants in SSMS.
Any hints?
Thanks, Birgit
Birgit Straker SCISYS Deutschland GmbH