October 22, 2008 at 2:35 am
I am tuning some JOIN queries. Every time I am using the the ANSI syntax, it is giving some performance gain regarding the DURATION. Though the CPU, READs or WRITES are same.
Like I am using the query "Select * from table1 t1 INNER JOIN table2 t2 ON t1.id=t2.id" instead of the query "Select * from table1 t1, table2 t2 where t1.id=t2.id"
The new syntax query shows lesser duration though READ is same.
Why is it happening? Is there any specific reason?
October 22, 2008 at 5:46 am
Are the query plans different?
My guess, and this is just a guess, the optimizer spends a little less time figuring out the ANSI 92 syntax than it does the ANSI 89 syntax. I'm pretty sure, with INNER JOINs, that the ultimate plan will be the same, but the time spent compiling is less.
But I may 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
October 22, 2008 at 7:03 am
Hi Grant,
Thank you for your reply. I have checked the query plans. Both the query plans are same, cost also same. I think ur guess is right. But there is no concrete reason.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply