April 22, 2008 at 4:08 am
Hi All,
Is there any way to conclude that the given query is efficient?
Thanks and Regards,
N.Prabhakaran
April 22, 2008 at 5:24 am
Look at the execution plan....
April 22, 2008 at 6:21 am
[font="Verdana"]Look at the Execution Time, right bottom hand ... :D[/font]
MH-09-AM-8694
April 22, 2008 at 7:41 am
as the others have said look at the execution plan and time.
Other general ideas are;
Avoid costly queries in your procedure, avoid cursors and try and use a set based solution rather that processing data per row.
Ensure you have a appropriate indexes on your table.
Dont select more columns or rows than you need.
Dont have un-neccesary joins
April 22, 2008 at 7:52 am
It's efficient when your users aren't complaining that its slow 🙂
April 22, 2008 at 8:36 am
What everyone else has said plus, assuming an OLTP system, you're avoiding scans, bookmark lookups (key lookups) and ineffecient joins in the queries. Assuming a reporting system, you're avoiding scans (the rest seem to be a part of the cost of operations).
"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 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply