In PostgreSQL, GiST is one index access method, not one single operator. What changes from case to case is the GiST operator class (opclass) used for a data type. In other words, when people say “GiST index types”, the precise thing is usually GiST operator classes / supported data-type families. GiST is a generalized balanced tree framework that can implement behaviors similar to R-tree and other search structures, and it also supports nearest-neighbor searches when the opclass defines a distance operator.
1) Core built-in GiST operator classes
PostgreSQL 18’s built-in GiST operator classes are these: box_ops, circle_ops, point_ops, poly_ops, inet_ops, range_ops, multirange_ops, tsvector_ops, and tsquery_ops. These are the native GiST families shipped in core, before adding optional extensions.
A. Geometric GiST types
These are the classic spatial-style GiST families:
They support geometric predicates such as overlap, containment, left/right/above/below relationships, and several of them also support nearest-neighbor ordering with <->. This is the area where GiST behaves most like an R-tree-style index.
Typical use:
CREATE INDEX ix_gist_point ON places USING GIST (location);
Good for:
B. Network-address GiST type
inet_ops is the GiST operator class for inet/cidr style network data. It supports subnet and ordering-style comparisons such as containment and overlap semantics for network ranges. One detail from the docs: inet_ops is not the default opclass for inet and cidr, so if you want GiST behavior there, you should specify it explicitly.
Example:
CREATE INDEX ix_gist_inet
ON hosts USING GIST (ip inet_ops);
Good for:
C. Range GiST type
range_ops is for PostgreSQL range types such as int4range, numrange, tsrange, tstzrange, and daterange. It supports overlap, containment, “strictly left/right of”, “does not extend to the right/left of”, adjacency, and related predicates.
Example:
CREATE INDEX ix_gist_booking_range
ON bookings USING GIST (period);
Good for:
This is one of the most important real-world GiST uses in PostgreSQL. And yes, tsrange is not a separate index type by itself; it is a range data type that uses the range_ops GiST operator class.
D. Multirange GiST type
multirange_ops is for multirange values, such as datemultirange, tsmultirange, tstzmultirange, etc. It supports overlap, containment, adjacency, left/right relations, and comparisons between multirange-to-multirange as well as multirange-to-range. Multiranges were added in PostgreSQL 14.
Good for:
E. Full-text related GiST types
Core PostgreSQL also includes:
tsvector_ops supports @@ (tsvector, tsquery), while tsquery_ops supports containment relationships between tsquery values. PostgreSQL’s GiST examples explicitly note that core provides text search support through these GiST implementations.
Example:
CREATE INDEX ix_gist_search
ON docs USING GIST (search_vector);
Good for:
But in many text-search workloads, GIN is usually the more common choice; GiST is still valid, just not usually the default recommendation for pure full-text search.
2) Important GiST operator classes from extensions
Besides core, PostgreSQL documentation points to several extensions that add GiST operator classes: btree_gist, cube, hstore, intarray, ltree, pg_trgm, and seg.
A. btree_gist
This extension gives GiST operator classes with B-tree-like behavior for many scalar data types, including integers, numerics, timestamps, date/time types, text, bytea, inet/cidr-like address types, uuid, bool, enums, and more. The docs note that these generally do not outperform normal B-tree indexes and cannot enforce uniqueness, but they are useful in multicolumn GiST indexes and for nearest-neighbor support on some scalar types.
Example:
CREATE EXTENSION btree_gist;
CREATE INDEX ix_gist_mixed
ON reservations USING GIST (room_id, period);
Why this matters:
B. cube
The cube extension adds a GiST operator class for multidimensional cube values. It supports equality, overlap, containment, contained-by, and nearest-neighbor style ordering operators such as <->, <#>, and <=>.
Good for:
C. hstore
The hstore extension provides the hstore data type for key/value pairs, and PostgreSQL lists it among the optional GiST-enabled modules.
Good for:
D. intarray
The intarray extension provides GiST operator classes for int4[]. The docs describe two GiST classes: gist__int_ops for small/medium data sets and gist__intbig_ops with a larger signature better suited to larger data sets with many distinct array values.
Good for:
E. ltree
The ltree extension supports hierarchical tree-like labels and is listed among PostgreSQL’s GiST-capable extensions.
Good for:
F. pg_trgm
pg_trgm provides trigram-based similarity search and includes GiST operator classes for fast similar-string searching.
Good for:
G. seg
The seg extension provides a floating-point interval / segment type and is listed among the GiST-enabled contrib modules.
Good for:
3) The practical classification
If you want the cleanest “full” view, GiST operator classes in PostgreSQL can be grouped like this:
Core GiST families
Extension GiST families
4) What GiST is best at
GiST is strongest when your predicates are not simple = / < / > only, but involve:
So in practice, the most important GiST use cases are usually:
5) Key caveat
Do not think of GiST as “one better B-tree”. For ordinary equality/range lookups on scalar columns, normal B-tree is usually the right first choice.
Even PostgreSQL says btree_gist generally does not outperform standard B-tree and cannot enforce uniqueness. GiST is chosen because it supports operator semantics B-tree cannot express well.