]> granicus.if.org Git - postgresql/commit
Fix cardinality estimates for parallel joins.
authorRobert Haas <rhaas@postgresql.org>
Fri, 13 Jan 2017 18:29:31 +0000 (13:29 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 13 Jan 2017 18:36:09 +0000 (13:36 -0500)
commit2d443ae1b0121e15265864d2b2143509fa70e8e4
tree69e5bd826cdb908e5f6a4765db532f3f01ac7e1f
parentd2d7163d470908c6325af73a7aea9eebeb52341d
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
src/backend/optimizer/path/costsize.c