The default for a reason
When you write CREATE INDEX without specifying a type, PostgreSQL uses a B-tree. B-trees are sorted, balanced, and support equality (=), range (<, >, BETWEEN), prefix matching (LIKE 'foo%'), and ORDER BY. They are the right answer for the vast majority of indexed columns.
What B-trees do well
- Equality:
WHERE email = 'x' - Range:
WHERE created_at BETWEEN '2026-01-01' AND '2026-04-30' - Prefix LIKE:
WHERE name LIKE 'A%'(NOT'%A') - Sorting:
ORDER BY created_at DESCcan use a B-tree directly
What B-trees can't help
- Suffix or substring LIKE (
'%foo','%foo%') — needs pg_trgm/GIN. - JSONB containment, full-text search — needs GIN.
- Array operators, geospatial — needs GIN/GiST.