January 4, 2013 at 1:08 am
Does statistics help to create optimal exec plan ?
When we do sp_recompile, sql optimizer destroy the existing and create a new exec plan ? but what if the statistics are out dated
Does recompliation get any benefit to have new plan ?
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
January 4, 2013 at 1:53 am
Bhuvnesh (1/4/2013)
Does statistics help to create optimal exec plan ?
Actual statistics, yes. This is they purpose.
Bhuvnesh (1/4/2013)
When we do sp_recompile, sql optimizer destroy the existing and create a new exec plan ? but what if the statistics are out datedDoes recompliation get any benefit to have new plan ?
If you assume that nothing else changed that impact an optimization process (index, proc parameters etc.) then optimizer should generate the same execution plan.
January 4, 2013 at 3:48 am
Statistics are one of the primary drivers to execution plans. And yes, if your statistics are out of date, the plans generated may be inappropriate. Maintaining statistics appropriately within a database can be a lot of work, but it's absolutely necessary to get good performance out of your queries.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply