In this chapter, one of the most important topics in the area of database work will be covered—indexing. In many cases, missing or wrong indexes are the main source of trouble, leading to bad performance, unexpected behavior, and a great deal of frustration. To avoid these issues, this chapter will present all the information that you need to make your life as easy as possible.
The following issues will be covered:
Understanding PostgreSQL indexing
Types of indexes
Managing operator classes
Detecting missing indexes
Reading execution plans
Fixing
LIKE
Fixing regular expressions
Improving indexes and functions
Indexes and insertions
Indexes and foreign keys