Re: nested loop semijoin estimates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: nested loop semijoin estimates
Date: 2015-05-31 22:08:03
Message-ID: 32356.1433110083@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> writes:
> On 05/30/15 23:16, Tom Lane wrote:
>> Attached is a draft patch for that. It fixes the problem for me:

> Seems to be working OK, but I still do get a Bitmap Heap Scan there (but
> more about that later).

Attached is an incremental patch (on top of the previous one) to allow
startup cost of parameterized paths to be considered when the relation
is the RHS of a semi or anti join. It seems reasonably clean except
for one thing: logically, we perhaps should remove the checks on
path->param_info from the last half of compare_path_costs_fuzzily(),
so as to increase the symmetry between parameterized paths and
unparameterized ones. However, when I did that, I got changes in some
of the regression test plans, and they didn't seem to be for the better.
So I left that alone. As-is, this patch doesn't seem to affect the
results for any existing regression tests.

> Do you plan to push that into 9.5, or 9.6? I assume it's a behavior
> change so that no back-patching, right?

Mumble. It's definitely a planner bug fix, and I believe that the effects
are narrowly constrained to cases where significantly better plans are
possible. So personally I'd be willing to back-patch it. But others
might see that differently, especially since it's been like this for a
long time and we only have one field complaint.

regards, tom lane

Attachment Content-Type Size
consider-startup-costs-for-semijoin-inner-rels.patch text/x-diff 18.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2015-05-31 23:34:59 Re: nested loop semijoin estimates
Previous Message Joel Jacobson 2015-05-31 20:44:54 Re: pg_xlog -> pg_xjournal?