Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The previous sections discussed simple queries. Even there we
found ways to improve the queries, sometimes with increasingly better
results over several iterations of tuning. When you work with
complicated queries with a lot of JOIN conditions, a lot of columns in WHERE clauses, and GROUP BY clauses, you have even more choices.
It’s possible to imagine that you could always find a way to make
performance even faster and that these improvements can continue
forever. So the question is when to consider a query properly optimized
and put a stop to the research.
An in-depth knowledge of performance techniques could help you choose the proper solution. But there are still basic considerations that can help you to stop, even if you don’t consider yourself an expert.