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@postgresql.org
Subject: pgsql: Add regression test case exercising the sorting path for hash in
Date: Sat, 16 Jul 2016 19:30:23 +0000
Message-ID: <E1bOVI7-0000is-5p@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Add regression test case exercising the sorting path for hash index build.

We've broken this code path at least twice in the past, so it's prudent
to have a test case that covers it.  To allow exercising the code path
without creating a very large (and slow to run) test case, redefine the
sort threshold to be bounded by maintenance_work_mem as well as the number
of available buffers.  While at it, fix an ancient oversight that when
building a temp index, the number of available buffers is not NBuffers but
NLocBuffer.  Also, if assertions are enabled, apply a direct test that the
sort actually does return the tuples in the expected order.

Peter Geoghegan

Patch: <CAM3SWZTBAo4hjbBd780+MrOKiKp_TMo1N3A0Rw9_im8gbD7fQA@mail.gmail.com>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9563d5b5e4c75e676d73a45546bd47b77c2bd739

Modified Files
--------------
src/backend/access/hash/hash.c             | 20 +++++++++++++++++---
src/backend/access/hash/hashsort.c         | 23 ++++++++++++++++++++---
src/test/regress/expected/create_index.out |  7 +++++++
src/test/regress/sql/create_index.sql      |  7 +++++++
4 files changed, 51 insertions(+), 6 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1bOVI7-0000is-5p@gemulon.postgresql.org>
Permalink:  ../E1bOVI7-0000is-5p@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1bOVI7-0000is-5p@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 regression test case exercising the sorting path for hash in
  In-Reply-To: <E1bOVI7-0000is-5p@gemulon.postgresql.org>
  References: <E1bOVI7-0000is-5p@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