pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix estimates for ModifyTable paths without RETURNING.
Date: Mon, 12 Oct 2020 11:27:40 +0000
Message-ID: <E1kRvzQ-0000Wh-6V@gemulon.postgresql.org> (raw)

Fix estimates for ModifyTable paths without RETURNING.

In the past, we always estimated that a ModifyTable node would emit the
same number of rows as its subpaths.  Without a RETURNING clause, the
correct estimate is zero.  Fix, in preparation for a proposed parallel
write patch that is sensitive to that number.

A remaining problem is that for RETURNING queries, the estimated width
is based on subpath output rather than the RETURNING tlist.

Reviewed-by: Greg Nancarrow <gregn4422@gmail.com>
Discussion: https://postgr.es/m/CAJcOf-cXnB5cnMKqWEp2E2z7Mvcd04iLVmV%3DqpFJrR3AcrTS3g%40mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/util/pathnode.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)



Message-ID: <E1kRvzQ-0000Wh-6V@gemulon.postgresql.org>
Permalink:  ../E1kRvzQ-0000Wh-6V@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1kRvzQ-0000Wh-6V@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: tmunro@postgresql.org
  Subject: Re: pgsql: Fix estimates for ModifyTable paths without RETURNING.
  In-Reply-To: <E1kRvzQ-0000Wh-6V@gemulon.postgresql.org>
  References: <E1kRvzQ-0000Wh-6V@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