How does one performance tune a SQL Query?
What tricks/tools/concepts can be used to change the performance of a SQL Query?
How can performance be Quantified?
What does one need to be careful of?
Note to moderators:
This is a huge question, should I have split it up in to multiple questions?
Note To Responders: Because this is a huge question please reference other questions/answers/articles rather than writing lengthy explanations.
Here some basic steps that need to follow:
SELECT
fields instead of using SELECT *
SELECT DISTINCT
INNER JOIN
(not WHERE
)WHERE
instead of HAVING
to define filtersI really like the book "Professional SQL Server 2005 Performance Tuning" to answer this. It's Wiley/Wrox, and no, I'm not an author, heh. But it explains a lot of the things you ask for here, plus hardware issues.
But yes, this question is way, way beyond the scope of something that can be answered in a comment box like this one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With