On 8 April 2016 at 02:46, Tom Lane <t...@sss.pgh.pa.us> wrote: > I'm also a bit suspicious of the fact that some of the plans in > aggregates.out changed from merge to hash joins; with basically > no stats at hand in those tests, that seems dubious. A quick look > at what the patch touched in costsize.c suggests that this might > be because you've effectively allowed cost_hashjoin to give a cost > discount for inner unique, but provided no similar intelligence > in cost_mergejoin.
(catching up) The only possible reason that the merge join plans have become a hash join is that hash join is costed more cheaply (same as SEMI JOIN) when the inner side is unique. The reason I didn't cost merge join differently is that there seems to be no special costing done there for SEMI joins already. I might be wrong, but I didn't feel like it was up to this patch to introduce that, though, perhaps a patch should go in before this one to do that. I understand this is 9.7 stuff now, but I feel like I should tie up the lose ends before they get forgotten. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers