April 24, 2013 at 11:31 am
When the Query Analizer estimates the cost of a query as 5.2837628, is that 5.2837628 of something? Or is it just a number to use for comparison to the cost of other versions of the query?
April 24, 2013 at 11:38 am
If I remember correctly, cost is the amount of time it took for an operation to run on the specific computer when optimizer costing code was created. It doesn't really have a unit or type.
Basically it is what your second question asks. You also need to look at other things like IO stats when tuning a query. You can't just use cost.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
April 24, 2013 at 11:43 am
A unitless number that is solely useful in comparing one plan to another. It's also estimated, so can be wrong.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
April 25, 2013 at 4:50 am
It's just a number used to perform & report on the math internal to the optimizer. It doesn't mean anything. However, it is represented as if it meant the amount of CPU and IO time spent executing each step. But that's not what it is. Like Gail says, it's just an estimate and can be wrong.
"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 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply