pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix bug #16784 in Disk-based Hash Aggregation.
Date: Sun, 27 Dec 2020 01:53:25 +0000
Message-ID: <E1ktLFN-0008Vb-Ut@gemulon.postgresql.org> (raw)

Fix bug #16784 in Disk-based Hash Aggregation.

Before processing tuples, agg_refill_hash_table() was setting all
pergroup pointers to NULL to signal to advance_aggregates() that it
should not attempt to advance groups that had spilled.

The problem was that it also set the pergroups for sorted grouping
sets to NULL, which caused rescanning to fail.

Instead, change agg_refill_hash_table() to only set the pergroups for
hashed grouping sets to NULL; and when compiling the expression, pass
doSort=false.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/16784-7ff169bf2c3d1588%40postgresql.org
Backpatch-through: 13

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7b8692eaf113a56933c77cf4c3993716ab37e763

Modified Files
--------------
src/backend/executor/nodeAgg.c             |  24 +++-
src/test/regress/expected/groupingsets.out | 207 +++++++++++++++++++++++++++++
src/test/regress/sql/groupingsets.sql      |  21 +++
3 files changed, 245 insertions(+), 7 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1ktLFN-0008Vb-Ut@gemulon.postgresql.org>
Permalink:  ../E1ktLFN-0008Vb-Ut@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ktLFN-0008Vb-Ut@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: jdavis@postgresql.org
  Subject: Re: pgsql: Fix bug #16784 in Disk-based Hash Aggregation.
  In-Reply-To: <E1ktLFN-0008Vb-Ut@gemulon.postgresql.org>
  References: <E1ktLFN-0008Vb-Ut@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