GiST Index
Generalized Search Tree
ELI5 — The Vibe Check
A GiST index is PostgreSQL's Swiss Army knife for indexing weird data types. Geometric shapes, ranges, full-text search, network addresses — if B-Tree can't handle it, GiST probably can. It's a framework for building custom indexes that support exotic queries.
Real Talk
GiST (Generalized Search Tree) is a balanced tree index structure in PostgreSQL that serves as a template for building custom index types. It supports geometric data (PostGIS), range types, full-text search (tsvector), ltree, and pg_trgm similarity searches. Unlike B-Tree (which only supports equality and ordering), GiST supports containment, overlap, nearest-neighbor, and custom operators.
When You'll Hear This
"Use a GiST index for the PostGIS geometry column — B-Tree can't do spatial queries." / "GiST indexes support containment operators like @> for range types."
Related Terms
B-Tree Index
A B-Tree index is the default index type that most databases create when you say CREATE INDEX.
Full-Text Search
Full-text search lets you search through text like Google does, not just exact matches.
GIN Index
A GIN index is like a book's index on steroids. Instead of pointing to one location per entry, each entry can point to thousands of locations.
PostgreSQL
PostgreSQL (just say 'Postgres') is the Swiss Army knife of databases.