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: Improve speed of hash index build.
Date: Thu, 28 Jul 2022 18:34:46 +0000
Message-ID: <E1oH8LN-001fUf-Hr@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1oH8LN-001fUf-Hr@gemulon.postgresql.org>
Permalink:  ../E1oH8LN-001fUf-Hr@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1oH8LN-001fUf-Hr@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: Improve speed of hash index build.
  In-Reply-To: <E1oH8LN-001fUf-Hr@gemulon.postgresql.org>
  References: <E1oH8LN-001fUf-Hr@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