January 9, 2012 at 4:34 pm
Hi,
I'm a beginner in Execution Plan. Can someone tell me what's the Query Cost means?
Part of the execution, it'll showing 100%, 50%, 0%, 99% and so on
Please help me to understand what's the % means?
January 9, 2012 at 11:59 pm
Total cost to execute a query is 100%. In execution plan this 100% is divided across each part. For example to run a query (100%) with table scan (65%) and sort (35%).
January 10, 2012 at 4:27 am
The cost of an execution plan is just an estimate based on how many CPU and I/O resources that the query optimizer estimates that query will use.
You can use this number to compare between two queries, but, because it's an estimate, it can be horribly wrong. This means you can't count on it as an accurate measure of performance. Instead, concentrate on I/O and execution time.
The total cost of the plan is the accumulation of the estimated costs of all the operations within that plan.
Although I don't like my explanation of plan costs (it's been updated in the new version which should come out as an e-book soon), for more information, try the execution plans book in my signature line.
"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
January 14, 2012 at 7:42 am
Grant Fritchey (1/10/2012)
The cost of an execution plan is just an estimate based on how many CPU and I/O resources that the query optimizer estimates that query will use.You can use this number to compare between two queries, but, because it's an estimate, it can be horribly wrong. This means you can't count on it as an accurate measure of performance. Instead, concentrate on I/O and execution time.
One of the most important things is that the execution cost is an estimate according to sql server statistics.
The total cost of the plan is the accumulation of the estimated costs of all the operations within that plan.
Although I don't like my explanation of plan costs (it's been updated in the new version which should come out as an e-book soon), for more information, try the execution plans book in my signature line.
you can got the IO/execution time using the script below
SET STATISTICS TIME ON
SET STATISTICS IO ON
January 14, 2012 at 8:02 am
Nice blog on query cost.
http://sqlblog.com/blogs/rob_farley/archive/2010/03/09/t-sql-tuesday-query-cost.aspx
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply