← Back to Notes
PostgreSQLJune 15, 2026

Postgres indexes default to B-tree, and that's usually right

Was about to reach for a GIN index on a column I'm filtering with simple equality and range checks. Turns out B-tree (the default) already handles =, <, >, BETWEEN, and IN efficiently. GIN is for containment queries — arrays, JSONB, full-text search.

Lesson: check what the default index type actually supports before assuming you need something specialized.