pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Etsuro Fujita <efujita@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: postgres_fdw: Fix assertion in estimate_path_cost_size().
Date: Fri, 05 Feb 2021 06:35:43 +0000
Message-ID: <E1l7uiV-0004oS-CK@gemulon.postgresql.org> (raw)

postgres_fdw: Fix assertion in estimate_path_cost_size().

Commit 08d2d58a2 added an assertion assuming that the retrieved_rows
estimate for a foreign relation, which is re-used to cost pre-sorted
foreign paths with local stats, is set to at least one row in
estimate_path_cost_size(), which isn't correct because if the relation
is a foreign table with tuples=0, the estimate would be set to 0 there
when not using remote estimates.

Per bug #16807 from Alexander Lakhin.  Back-patch to v13 where the
aforementioned commit went in.

Author: Etsuro Fujita
Reviewed-by: Kyotaro Horiguchi
Discussion: https://postgr.es/m/16807-9fe4e08fbaa5c7ce%40postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5e7fa189ee92d5ecf42a295c336625d71bfe876d

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 18 ++++++++++++++++++
contrib/postgres_fdw/postgres_fdw.c            |  2 +-
contrib/postgres_fdw/sql/postgres_fdw.sql      | 12 ++++++++++++
3 files changed, 31 insertions(+), 1 deletion(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1l7uiV-0004oS-CK@gemulon.postgresql.org>
Permalink:  ../E1l7uiV-0004oS-CK@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l7uiV-0004oS-CK@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: efujita@postgresql.org
  Subject: Re: pgsql: postgres_fdw: Fix assertion in estimate_path_cost_size().
  In-Reply-To: <E1l7uiV-0004oS-CK@gemulon.postgresql.org>
  References: <E1l7uiV-0004oS-CK@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