PostgreSQL DBA

Indexing & Statistics

Question

B-tree versus hash indexes: what differs, and when should each be used?

Answer

B-tree supports equality, ranges, ordering, and several null tests. Hash supports equality comparisons. Use B-tree for general-purpose indexed access; consider hash where equality is the sole required search behavior.

This is 8 of 23 free samples for PostgreSQL DBA.

More PostgreSQL DBA topic samples