The Default B-Tree Index
coreintermediateCREATE INDEX with no method specified creates a B-tree index — PostgreSQL's general-purpose, default index type, built as a balanced tree structure that keeps entries sorted, so any equality or range comparison can find its starting point in roughly logarithmic time rather than scanning everything.
Think of it as
A B-tree is the right default because it handles the overwhelming majority of real query needs from one structure: exact matches, ranges, sorting — all fall naturally out of "keep the data sorted in a tree that's cheap to search and cheap to keep balanced as data changes." Reaching for a different index type (covered in Other Index Types) is the exception, justified by a specific need a B-tree cannot serve well — full-text search, exact equality on an unordered type, or a few other special cases — not the default choice.
What we're doing: Confirm that an index created with no explicit method is in fact a B-tree, via pg_indexes / the catalog.
- 1
- No USING clause at all — relying entirely on the default.
- 3–5
- The catalog's own recorded definition shows "USING btree" explicitly, proving that is exactly what was created.
indexname | indexdef
-----------+---------------------------------------------------------
idx_email | CREATE INDEX idx_email ON public.accounts USING btree (email)Why this works: This directly confirms the documented default rather than assuming it — pg_indexes' indexdef always spells out the actual index method used, which is the authoritative way to check what kind of index any CREATE INDEX statement actually produced, with or without an explicit USING clause.
Assuming a specialized index type is needed without first checking whether the default B-tree already handles the query
Wrong
Better
What you see: A specialized index type is chosen for a query pattern (simple equality, range, or sorting) that a default B-tree would have served identically well, adding unnecessary unfamiliarity and, for some index types, real overhead with no corresponding benefit.
Why: B-tree already covers equality, range comparisons, and ORDER BY — the vast majority of real query needs — so reaching for GiST, GIN, or another specialized type only makes sense when the query pattern genuinely needs something B-tree cannot do (covered in Other Index Types), not as a default habit.
- Whole: CREATE INDEX idx_email ON accounts (email);
- CREATE INDEX idx_email — Index name: the name recorded in pg_indexes
- ON accounts — Target table: the table the index is built over
- (email) — Indexed column: sorted, balanced entries for this column
Remember: CREATE INDEX with no USING clause creates a B-tree — the default, general-purpose index type covering the overwhelming majority of real query needs (equality, range, ORDER BY). Only B-tree indexes can be UNIQUE. Reach for a specialized index type only when a specific need justifies it, not as a default habit.
See also: equality range order by and prefix use cases · hash indexes

