pgsql: Fix cardinality estimates for parallel joins.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix cardinality estimates for parallel joins.
Date: 2017-01-13 18:37:58
Message-ID: E1cS6je-0004eL-Id@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Fix cardinality estimates for parallel joins.

For a partial path, the cardinality estimate needs to reflect the
number of rows we think each worker will see, rather than the total
number of rows; otherwise, costing will go wrong. The previous coding
got this completely wrong for parallel joins.

Unfortunately, this change may destabilize plans for users of 9.6 who
have enabled parallel query, but since 9.6 is still fairly new I'm
hoping expectations won't be too settled yet. Also, this is really a
brown-paper-bag bug, so leaving it unfixed for the entire lifetime of
9.6 seems unwise.

Related reports (whose import I initially failed to recognize) by
Tomas Vondra and Tom Lane.

Discussion: http://postgr.es/m/CA+TgmoaDxZ5z5Kw_oCQoymNxNoVaTCXzPaODcOuao=CzK8dMZw@mail.gmail.com

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2d443ae1b0121e15265864d2b2143509fa70e8e4

Modified Files
--------------
src/backend/optimizer/path/costsize.c | 74 +++++++++++++++++++++++------------
1 file changed, 48 insertions(+), 26 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2017-01-13 19:07:02 pgsql: Fix a bug in how we generate partition constraints.
Previous Message Tom Lane 2017-01-13 13:35:59 Re: [COMMITTERS] pgsql: Fix field order in struct catcache.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-01-13 18:38:00 Re: plan_rows confusion with parallel queries
Previous Message Serge Rielau 2017-01-13 18:35:56 Re: Packages: Again