Description
Description
In PostgreSql - BRIN (Block Range Index) is a simple index type that can provide significant space savings over BTREE.
A GiST (Generalized Search Tree)-based index. The column can be of tsvector
or tsquery
type See #5104. Optional integer parameter siglen determines signature length in bytes.
Following on from GIN support #5026, now merged, BRIN is standalone and doesn't require any extra types. Other index methods (SP-GiST) are available but require additional types or extensions to work.
Additional work to consider:
- Support and validate storage parameters for appropriate index types BTREE, GIN, GIST and BRIN
- Support functional index e.g
CREATE INDEX idx ON Test USING btree (upper(fullname))
- The pg_trgm module provides GiST and GIN index operator classes on TEXT columns https://www.postgresql.org/docs/current/pgtrgm.html#PGTRGM-INDEX - may be easier to add to core as trigram extension can be used with a custom dialect.
https://www.postgresql.org/docs/16/sql-createindex.html#SQL-CREATEINDEX-STORAGE-PARAMETERS
https://www.postgresql.org/docs/16/indexes-opclass.html Many opclasses most are defaults already for column types
CREATE INDEX brin_idx ON test
USING BRIN (sequential)
WITH (pages_per_range=64, autosummarize=on);
CREATE UNIQUE INDEX title_idx ON films (title) WITH (fillfactor = 70);
CREATE INDEX name ON table USING GIST (column [ { DEFAULT | tsvector_ops } (siglen = number) ] );
CREATE INDEX test_index ON test_table (col varchar_pattern_ops);