pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add a hash opclass for type "tid".
Date: Sun, 30 Dec 2018 20:40:16 +0000
Message-ID: <E1gdhse-00040N-JP@gemulon.postgresql.org> (raw)

Add a hash opclass for type "tid".

Up to now we've not worried much about joins where the join key is a
relation's CTID column, reasoning that storing a table's CTIDs in some
other table would be pretty useless.  However, there are use-cases for
this sort of query involving self-joins, so that argument doesn't really
hold water.

With larger relations, a merge or hash join is desirable.  We had a btree
opclass for type "tid", allowing merge joins on CTID, but no hash opclass
so that hash joins weren't possible.  Add the missing infrastructure.

This also potentially enables hash aggregation on "tid", though the
use-cases for that aren't too clear.

Discussion: https://postgr.es/m/1853.1545453106@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0a6ea4001a9dff64e9ba66f68855a59a1bf69bc9

Modified Files
--------------
src/backend/utils/adt/tid.c           | 28 +++++++++++++++++++++
src/include/catalog/catversion.h      |  2 +-
src/include/catalog/pg_amop.dat       |  4 +++
src/include/catalog/pg_amproc.dat     |  4 +++
src/include/catalog/pg_opclass.dat    |  2 ++
src/include/catalog/pg_operator.dat   |  7 +++---
src/include/catalog/pg_opfamily.dat   |  2 ++
src/include/catalog/pg_proc.dat       |  6 +++++
src/test/regress/expected/tidscan.out | 46 +++++++++++++++++++++++++++++++++++
src/test/regress/sql/tidscan.sql      | 14 +++++++++++
10 files changed, 111 insertions(+), 4 deletions(-)



Message-ID: <E1gdhse-00040N-JP@gemulon.postgresql.org>
Permalink:  ../E1gdhse-00040N-JP@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1gdhse-00040N-JP@gemulon.postgresql.org

 · 

reply

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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Add a hash opclass for type "tid".
  In-Reply-To: <E1gdhse-00040N-JP@gemulon.postgresql.org>
  References: <E1gdhse-00040N-JP@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