$ open source · GPL-3.0 — need a commercial license? imqueue.com →

IndexMethod enum

The index methods Postgres offers, for ColumnIndexOptions.method.

Signature:

export declare enum IndexMethod 

Enumeration Members

Member

Value

Description

BRIN

"BRIN"

Block range: huge tables whose values track their physical order.

BTREE

"BTREE"

Balanced tree: equality, ranges and ordering. Postgres's default.

GIN

"GIN"

Inverted index: containment in arrays, jsonb and full-text.

GIST

"GIST"

Generalised search tree: geometric types, ranges, full-text.

HASH

"HASH"

Hash: equality only, and smaller than a btree for that alone.

SPGIST

"SPGIST"

Space-partitioned GiST: quadtrees, tries and other unbalanced trees.

Remarks

Postgres uses BTREE when nothing is given, and it is the only method with an ordered key — so it is the one to want unless the data has a shape another method is built for.