From 80b986cf528c912f4efc2b0e9f03611f0f15f4df Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Mon, 28 Mar 2016 19:11:12 -0300 Subject: [PATCH] Mention BRIN as able to do multi-column indexes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documentation mentioned B-tree, GiST and GIN as able to do multicolumn indexes; I failed to add BRIN to the list. Author: Petr Jediný Reviewed-By: Fujii Masao, Emre Hasegeli --- doc/src/sgml/indices.sgml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/src/sgml/indices.sgml b/doc/src/sgml/indices.sgml index 23bbec6eb7..5f72e7d073 100644 --- a/doc/src/sgml/indices.sgml +++ b/doc/src/sgml/indices.sgml @@ -395,7 +395,8 @@ CREATE INDEX test2_mm_idx ON test2 (major, minor); - Currently, only the B-tree, GiST and GIN index types support multicolumn + Currently, only the B-tree, GiST, GIN, and BRIN + index types support multicolumn indexes. Up to 32 columns can be specified. (This limit can be altered when building PostgreSQL; see the file pg_config_manual.h.) @@ -440,6 +441,15 @@ CREATE INDEX test2_mm_idx ON test2 (major, minor); the query conditions use. + + A multicolumn BRIN index can be used with query conditions that + involve any subset of the index's columns. Like GIN and unlike B-tree or + GiST, index search effectiveness is the same regardless of which index + column(s) the query conditions use. The only reason to have multiple BRIN + indexes instead of one multicolumn BRIN index on a single table is to have + a different pages_per_range storage parameter. + + Of course, each column must be used with operators appropriate to the index type; clauses that involve other operators will not be considered.