BRIN minmax-multi indexes
Tomas Vondra <tomas.vondra@postgresql.org>
BRIN minmax-multi indexes Adds BRIN opclasses similar to the existing minmax, except that instead of summarizing the page range into a single [min,max] range, the summary consists of multiple ranges and/or points, allowing gaps. This allows more efficient handling of data with poor correlation to physical location within the table and/or outlier values, for which the regular minmax opclassed tend to work poorly. It's possible to specify the number of values kept for each page range, either as a single point or an interval boundary. CREATE TABLE t (a int); CREATE INDEX ON t USING brin (a int4_minmax_multi_ops(values_per_range=16)); When building the summary, the values are combined into intervals with the goal to minimize the "covering" (sum of interval lengths), using a support procedure computing distance between two values. Bump catversion, due to various catalog changes. Author: Tomas Vondra <tomas.vondra@postgresql.org> Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org> Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com> Reviewed-by: Sokolov Yura <y.sokolov@postgrespro.ru> Reviewed-by: John Naylor <john.naylor@enterprisedb.com> Discussion: https://postgr.es/m/c1138ead-7668-f0e1-0638-c3be3237e812@2ndquadrant.com Discussion: https://postgr.es/m/5d78b774-7e9c-c94e-12cf-fef51cc89b1a%402ndquadrant.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/brin.sgml | modified | +270 −10 |
| src/backend/access/brin/brin_minmax_multi.c | added | +3036 −0 |
| src/backend/access/brin/brin_tuple.c | modified | +17 −0 |
| src/backend/access/brin/Makefile | modified | +1 −0 |
| src/include/access/brin_tuple.h | modified | +8 −0 |
| src/include/access/transam.h | modified | +5 −5 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_amop.dat | modified | +544 −0 |
| src/include/catalog/pg_amproc.dat | modified | +362 −0 |
| src/include/catalog/pg_opclass.dat | modified | +57 −0 |
| src/include/catalog/pg_opfamily.dat | modified | +28 −0 |
| src/include/catalog/pg_proc.dat | modified | +85 −0 |
| src/include/catalog/pg_type.dat | modified | +6 −0 |
| src/test/regress/expected/brin_multi.out | added | +450 −0 |
| src/test/regress/expected/psql.out | modified | +7 −6 |
| src/test/regress/expected/type_sanity.out | modified | +4 −3 |
| src/test/regress/parallel_schedule | modified | +1 −1 |
| src/test/regress/serial_schedule | modified | +1 −0 |
| src/test/regress/sql/brin_multi.sql | added | +403 −0 |
Documentation touched
Discussion
- WIP: BRIN multi-range indexes 179 messages · 2017-10-25 → 2021-03-27
- WIP: BRIN bloom indexes 13 messages · 2017-10-19 → 2017-10-28