...

/

Index Access Methods

Index Access Methods

Explore different algorithms implemented for indexing different types of data in PostgreSQL.

PostgreSQL implements several index access methods. An access method is a generic algorithm with a clean API that can be implemented for compatible data types. Each algorithm is well adapted to some use cases, which is why it’s interesting to maintain several access methods.

The PostgreSQL documentation covers index types in the “Indexes” chapter on the official documentation of PostgreSQL and tells us the following:

PostgreSQL provides several index types: B-Tree, Hash, GiST, SP-GiST, GIN, and BRIN. Each index type uses a different algorithm that is best suited to different types of queries. By default, the CREATE INDEX command creates B-Tree indexes which fit the most common situations.

Each index access method has been designed to solve a specific use case.

Balanced tree (B-Tree)

Balanced indexes are the most commonly used by a long shot because they are very efficient and provide ...