Add BRIN infrastructure for "inclusion" opclasses

Enterprise / PostgreSQL - Alvaro Herrera [alvh.no-ip.org] - 15 May 2015 16:05 UTC

This lets BRIN be used with R-Tree-like indexing strategies.

Also provided are operator classes for range types, box and inet/cidr. The infrastructure provided here should be sufficient to create operator classes for similar datatypes; for instance, opclasses for PostGIS geometries should be doable, though we didn't try to implement one.

(A box/point opclass was also submitted, but we ripped it out before commit because the handling of floating point comparisons in existing code is inconsistent and would generate corrupt indexes.)

Author: Emre Hasegeli. Cosmetic changes by me Review: Andreas Karlsson

b0b7be6 Add BRIN infrastructure for "inclusion" opclasses
doc/src/sgml/brin.sgml | 53 ++-
src/backend/access/brin/Makefile | 2 +-
src/backend/access/brin/brin.c | 90 +---
src/backend/access/brin/brin_inclusion.c | 696 ++++++++++++++++++++++++++++++
src/backend/access/brin/brin_minmax.c | 7 +
src/backend/utils/adt/network_gist.c | 4 +-
src/include/access/brin_internal.h | 6 -
src/include/access/stratnum.h | 4 +-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_am.h | 3 +-
src/include/catalog/pg_amop.h | 37 ++
src/include/catalog/pg_amproc.h | 23 +
src/include/catalog/pg_opclass.h | 6 +-
src/include/catalog/pg_opfamily.h | 3 +
src/include/catalog/pg_proc.h | 10 +
src/test/regress/expected/brin.out | 31 +-
src/test/regress/expected/opr_sanity.out | 25 +-
src/test/regress/sql/brin.sql | 31 +-
18 files changed, 928 insertions(+), 105 deletions(-)

Upstream: git.postgresql.org


  • Share