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: Extend ExecBuildAggTrans() to support a NULL pointer check.
Date: Thu, 05 Mar 2020 01:41:19 +0000
Message-ID: <E1j9fVn-00046Q-BG@gemulon.postgresql.org> (raw)

Extend ExecBuildAggTrans() to support a NULL pointer check.

Optionally push a step to check for a NULL pointer to the pergroup
state.

This will be important for disk-based hash aggregation in combination
with grouping sets. When memory limits are reached, a given tuple may
find its per-group state for some grouping sets but not others. For
the former, it advances the per-group state as normal; for the latter,
it skips evaluation and the calling code will have to spill the tuple
and reprocess it in a later batch.

Add the NULL check as a separate expression step because in some
common cases it's not needed.

Discussion: https://postgr.es/m/20200221202212.ssb2qpmdgrnx52sj%40alap3.anarazel.de

Branch
------
master

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

Modified Files
--------------
src/backend/executor/execExpr.c       | 39 ++++++++++++++++++++++++++++++-----
src/backend/executor/execExprInterp.c | 17 +++++++++++++++
src/backend/executor/nodeAgg.c        |  3 ++-
src/backend/jit/llvm/llvmjit_expr.c   | 39 +++++++++++++++++++++++++++++++++++
src/include/executor/execExpr.h       |  8 +++++++
src/include/executor/executor.h       |  2 +-
6 files changed, 101 insertions(+), 7 deletions(-)



Message-ID: <E1j9fVn-00046Q-BG@gemulon.postgresql.org>
Permalink:  ../E1j9fVn-00046Q-BG@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1j9fVn-00046Q-BG@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: Extend ExecBuildAggTrans() to support a NULL pointer check.
  In-Reply-To: <E1j9fVn-00046Q-BG@gemulon.postgresql.org>
  References: <E1j9fVn-00046Q-BG@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