Developers often fear databases and treat them like blackboxes, but no more! In this talk I present advanced indexing techniques using special B-Tree index features, Hash indexes and BRIN indexes in PostgreSQL. We’ll develop a small app and troubleshoot real performance problems using indexes.
Indexes are extremely powerful and ORMs like Django and SQLAlchemy provide many ways of using them to make queries faster and more efficient. However, developers who are not familiar with the different features and index types in PostgreSQL can end up choosing the wrong type of index. This can result in sub-par performance and increased storage and maintenance costs!
In the talk I will demonstrate the advantages and disadvantages of different indexes in PostgreSQL such as partial, covering and function based B-Tree indexes, as well as lesser known index types such as Hash and Block Range (BRIN) index. To make it as realistic as possible we’ll optimize different use-cases in a Django app using different index types. By the end of this talk you’ll understand how the different types of indexes work, when to use them, and how.