Friday, August 25, 2006

Why does SQL server always change execution plan?

I just don't get it why does SQL server always changes execution plan.

I run

EXEC sp_MSforeachtable 'UPDATE STATISTICS ? WITH FULLSCAN'

and still cannot get the same execution plan as the last time. I don't think any data were changed since a few weeks ago. And why does the SQL server all the sudden start usign hash or merge joins and try to use parallelism? I worked a couple of days ago to optimize the query and I've got it down to 71 milliseconds. Today it is back to 600 ms. Is the solution to use the real database, for example Oracle?

No comments: