pgsql: Improve speed of hash index build.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Improve speed of hash index build.
Date: 2022-07-28 18:34:46
Message-ID: E1oH8LN-001fUf-Hr@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve speed of hash index build.

In the initial data sort, if the bucket numbers are the same then
next sort on the hash value. Because index pages are kept in
hash value order, this gains a little speed by allowing the
eventual tuple insertions to be done sequentially, avoiding repeated
data movement within PageAddItem. This seems to be good for overall
speedup of 5%-9%, depending on the incoming data.

Simon Riggs, reviewed by Amit Kapila

Discussion: https://postgr.es/m/CANbhV-FG-1ZNMBuwhUF7AxxJz3u5137dYL-o6hchK1V_dMw86g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e09d7a1262c659578065eaf7edafe606d2c8ebf2

Modified Files
--------------
src/backend/access/hash/hashsort.c | 7 ++++---
src/backend/utils/sort/tuplesortvariants.c | 19 +++++++++++++++++--
2 files changed, 21 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2022-07-28 20:16:00 pgsql: Use TRUNCATE to preserve relfilenode for pg_largeobject + index.
Previous Message Alvaro Herrera 2022-07-28 16:25:23 pgsql: doc: avoid saying "inheritance" ...