Summary
In this chapter, you have covered a wide variety of topics designed to help you understand and improve the performance of your 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. You discussed different compromises and considerations that can be made to reduce the time needed to execute queries. You considered several 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. You then moved on to learn how to kill long-running queries. You also covered an in-depth look at functions and automatic function calls using triggers and learned about the \df
and \sf
commands.
In the next chapter, you will combine all the topics you have covered thus far in a final case study, applying your SQL knowledge and the scientific method in general, as you solve a real-world problem...