Summary
In this chapter, we have covered a wide variety of topics designed to help us understand and improve the performance of our SQL queries. The chapter began with a thorough discussion of the query planner, (including the EXPLAIN
and ANALYZE
statements) as well as various indexing methods. We discussed a number of different compromises and considerations that can be made to reduce the time needed to execute queries.
We considered a number of scenarios where indexing methods would be of benefit and others where the query planner may disregard the index, thus reducing the efficiency of the query. We then moved on to the use of joins to efficiently combine information from a number of different tables and ended with an in-depth look at functions and automatic function calls through the use of triggers. We have also covered the /df and /sf commands and learned how to kill long-running queries.
In the next chapter, we will combine all of the topics we have covered thus far in...