Making Use of Indexes
In Chapter 2, Understanding Transactions and Locking, you learned about concurrency and locking. In this chapter, it’s time to attack indexing and therefore the very core of performance head-on. The importance of this topic cannot be stressed enough – indexing is (and will most likely remain) one of the most important topics in the work of every database engineer.
Having over 25 years of professional, full-time PostgreSQL consulting and PostgreSQL 24/7 support experience (www.cybertec-postgresql.com), I can say one thing for sure: bad indexing is the main source of bad performance. Of course, it’s important to adjust memory parameters and all that. However, this is all in vain if indexes aren’t used properly. There is simply no replacement for a missing index. To make my point clear, there’s no way to achieve good performance without proper indexing, so always make it a point to check the indexing if performance is bad. My...