PostgreSQL supports different indexes; each index can be used for a certain scenario or data type, as follows:
- B-tree index: This is the default index in PostgreSQL when the index type is not specified with the CREATE INDEX command. The B stands for balanced, which means that the data on both sides of the tree is roughly equal. A B-tree can be used for equality, ranges, and null predicates. The B-tree index supports all PostgreSQL data types.
- Hash index: Prior to PostgreSQL 10, hash indexes are not well supported. They are not transaction-safe and are not replicated to the slave nodes in streaming replication. With PostgreSQL 10, the hash index limitations have been tackled. It is useful for equality predicates (=).
- Generalized ...