pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <rhodiumtoad@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Request small targetlist for input to WindowAgg.
Date: Wed, 06 Nov 2019 05:01:21 +0000
Message-ID: <E1iSDRZ-00043y-SY@gemulon.postgresql.org> (raw)

Request small targetlist for input to WindowAgg.

WindowAgg will potentially store large numbers of input rows into
tuplestores to allow access to other rows in the frame. If the input
is coming via an explicit Sort node, then unneeded columns will
already have been discarded (since Sort requests a small tlist); but
there are idioms like COUNT(*) OVER () that result in the input not
being sorted at all, and cases where the input is being sorted by some
means other than a Sort; if we don't request a small tlist, then
WindowAgg's storage requirement is inflated by the unneeded columns.

Backpatch back to 9.6, where the current tlist handling was added.
(Prior to that, WindowAgg would always use a small tlist.)

Discussion: https://postgr.es/m/87a7ator8n.fsf@news-spur.riddles.org.uk

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/plan/createplan.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)



view thread (5+ messages)

Message-ID: <E1iSDRZ-00043y-SY@gemulon.postgresql.org>
Permalink:  ../E1iSDRZ-00043y-SY@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iSDRZ-00043y-SY@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: rhodiumtoad@postgresql.org
  Subject: Re: pgsql: Request small targetlist for input to WindowAgg.
  In-Reply-To: <E1iSDRZ-00043y-SY@gemulon.postgresql.org>
  References: <E1iSDRZ-00043y-SY@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