pgsql: Fix cost_rescan() to account for multi-batch hashing correctly.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix cost_rescan() to account for multi-batch hashing correctly.
Date: 2016-07-27 21:45:13
Message-ID: E1bSWdd-00050z-2J@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix cost_rescan() to account for multi-batch hashing correctly.

cost_rescan assumed that we don't need to rebuild the hash table when
rescanning a hash join. However, that's currently only true for
single-batch joins; for a multi-batch join we must charge full freight.

This probably has escaped notice because we'd be unlikely to put a hash
join on the inside of a nestloop anyway. Nonetheless, it's wrong.
Fix in HEAD, but don't backpatch for fear of destabilizing plans in
stable releases.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/69995c3b3fd64361bb4d3938315f3e88ccc01e53

Modified Files
--------------
src/backend/optimizer/path/costsize.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-07-28 06:09:01 pgsql: tqueue.c's record-typmod hashtables need the HASH_BLOBS option.
Previous Message Robert Haas 2016-07-27 14:25:10 pgsql: Fix thinko in copyParamList.