SqlShare.com Logo
 
Skip Navigation Links
Home
Video List
Events
Classes
About Us
Login / Register
Subscribe RSS Feed 

Idera SQL Check

Performance Tuning Puzzle - Part 2

In this follow up to our puzzle we look at the impact of adding a recommended index, try an experiment with hard coding values, and finally rewrite the query slightly to try to get the performance we want. We started at 580 reads, and at completion we're down to 21, a nice gain! It shows some of the ideas behind tuning, and it shows that even getting performance from a simple query may take some thought.

Duration:
6 mins 31 secs
Skill Level:
100
Rating:
4.65 out of 5
Publish Date:
April 30, 2010
Performance Tuning Puzzle - Part 2 You must be logged in to view this video.  
Bookmark and Share
 
1=Poor, 3=Good, 5=Excellent

About the Author

Image of Andy Warren
Andy Warren is a software trainer focusing on SQL Server, a member of the PASS Board of Directors, and a principal in this site - SQLShare.com.

References



Comments
Marcelo Marim on 4/30/2010
I would like to see his runing the latest query without the index and see how much you will save in reads. Sometimes just making changes to the query will improve the reads without the need of a new index.

Kasey Wheeler on 4/30/2010
Great lesson...nice vid.

Rick Fonner on 4/30/2010
This is the first time I have seen all of the performance tuning items used together, execution plan, profiler and SQL/index. A thing of beauty!!! Thank you.

Kyle on 4/30/2010
AWESOME!!!! More please!!! I am very interested in Performance Tuning.

Luke on 4/30/2010
I would defintely find more videos like this useful. Thanks!

Andrzej Pilacik on 4/30/2010
great tuturial

Douglas Kemp on 4/30/2010
I liked the concept and approach in this video

7F718A6344 on 4/30/2010
Good examples

Kevin on 4/30/2010
Excellent process. Thanks.

325BD96788 on 4/30/2010
Nice. Keep up with the challenges!

Henrique on 4/30/2010
very good. It´s complete! Perfect study case.

msuess on 4/30/2010
I wish there was more science than art in this.

Kathy Connolly on 4/30/2010
It was great! Please have more quizes, Putting things into practice is much different than just theroy. Seeing the thought process behind the solution was very helpful.

Prashant Thakwani on 4/30/2010
One great explanation from millions of query tuning techiniques.

Arun on 4/30/2010
Excellent!!!!!!!!!!

ranga rao on 5/1/2010
Very good.

32DE12EB89 on 5/1/2010
More tuning, please. Excellent insights.

Chris on 5/1/2010
Excellent!!!

Andy Jarman on 5/1/2010
Great example. Although I was surprised there was no mention of the different type of JOIN between the two examples (NESTED LOOP/HASH) - which is making all the difference.

Anthony Siciliano on 5/1/2010
Very good. Performance tuning is the key to successful dba. Thank you!

Dion on 5/2/2010
great will help me lots

Troy on 5/2/2010
Great informative video. Obviously there is 'more than 1 way to skin a cat', but this gets people thinking about the possibilities!! Great!

Alex Fekken on 5/2/2010
Thanks for the puzzle-demo Andy. I was surprised (shocked in fact) to see that SQL Server apparently did not "see" that the SELECT embedded in the original WHERE clause was not correlated with the outer SELECT. Shouldn't that be one of the easiest and most obvious things for a query optimizer to pick up? Especially since the stats would show that the inner query could never return more than a handfull of records?

Viswanath on 5/3/2010
By Adding the index I do not see much change in teh execution time. But yes need toi write the proper querry and definitly ts impact will be huge as shown in te example. Writing effective querry is more important. Thanks for sample. its really useful

Jim Buttery on 5/3/2010
It would be nice to have a version for SQL 2005, but I'll just move it to my 2008 QA environment. I do think that optimization (like a simple best practice of an index) is much more efficient than playing with queries. Play with 14 million records instead of 14,000 and look at the plan.

Rodney on 5/3/2010
Excellent post, Andy.

Really Good One... Definitelt this will help us...

Fantastic Tuning Example.

Bill Johnson on 5/5/2010
Good example while it's still simple enough to see! Thanks

Lynn Rosini on 5/5/2010
I was able to get down to 25 reads. I would be interested in how to get it down to less reads. Another video would be great.

David Hunter on 5/12/2010
Excellent video !

8A7E4A6C54 on 5/18/2010
Great session

Shashank Banerjea on 5/19/2010
It was interesting to see how removing the IN Clause with SQL Select dropped the read counts.

Mark Holahan on 5/27/2010
Very good presentation, pace, and content. Thanks!

mark brito on 5/29/2010
Excellent! Read metrics in particular.

Kent on 6/6/2010
Great Demononstration

Bruce Edney on 7/1/2010
great info - thanks

Tonci on 7/7/2010
just great! thank you.

Rick on 12/10/2012
Without changing the query, I added a non-clustered index on the CountAsAttending field of the RegistrationStatus table and it dropped the reads to 10. The query plan has two index seeks.



Must Be Logged In
 

How Do I Become a Video Author? |  Newsletter History

Copyright © Fourdeuce, Inc., 2005-2009. All Rights Reserved | Privacy Policy | Terms & Conditions