From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add equalimage B-Tree support functions.
Date: Wed, 26 Feb 2020 19:29:56 +0000
Message-ID: <E1j72NY-0002gi-2B@gemulon.postgresql.org> (raw)
Add equalimage B-Tree support functions.
Invent the concept of a B-Tree equalimage ("equality implies image
equality") support function, registered as support function 4. This
indicates whether it is safe (or not safe) to apply optimizations that
assume that any two datums considered equal by an operator class's order
method must be interchangeable without any loss of semantic information.
This is static information about an operator class and a collation.
Register an equalimage routine for almost all of the existing B-Tree
opclasses. We only need two trivial routines for all of the opclasses
that are included with the core distribution. There is one routine for
opclasses that index non-collatable types (which returns 'true'
unconditionally), plus another routine for collatable types (which
returns 'true' when the collation is a deterministic collation).
This patch is infrastructure for an upcoming patch that adds B-Tree
deduplication.
Author: Peter Geoghegan, Anastasia Lubennikova
Discussion: https://postgr.es/m/CAH2-Wzn3Ee49Gmxb7V1VJ3-AC8fWn-Fr8pfWQebHe8rYRxt5OQ@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/612a1ab76724aa1514b6509269342649f8cab375
Modified Files
--------------
doc/src/sgml/btree.sgml | 96 ++++++++++++++++++++++++++++-
doc/src/sgml/ref/alter_opfamily.sgml | 7 ++-
doc/src/sgml/ref/create_opclass.sgml | 14 +++--
doc/src/sgml/xindex.sgml | 18 ++++--
src/backend/access/nbtree/nbtutils.c | 73 ++++++++++++++++++++++
src/backend/access/nbtree/nbtvalidate.c | 8 ++-
src/backend/commands/opclasscmds.c | 30 ++++++++-
src/backend/utils/adt/datum.c | 26 ++++++++
src/backend/utils/adt/varlena.c | 20 ++++++
src/bin/pg_dump/t/002_pg_dump.pl | 12 ++--
src/include/access/nbtree.h | 8 ++-
src/include/catalog/catversion.h | 2 +-
src/include/catalog/pg_amproc.dat | 60 ++++++++++++++++++
src/include/catalog/pg_proc.dat | 6 ++
src/test/regress/expected/alter_generic.out | 8 ++-
src/test/regress/expected/opr_sanity.out | 36 +++++++++++
src/test/regress/sql/alter_generic.sql | 3 +
src/test/regress/sql/opr_sanity.sql | 18 ++++++
18 files changed, 418 insertions(+), 27 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: pg@bowt.ie
Subject: Re: pgsql: Add equalimage B-Tree support functions.
In-Reply-To: <E1j72NY-0002gi-2B@gemulon.postgresql.org>
References: <E1j72NY-0002gi-2B@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox