Re: planner weirdness: a join uses nestloop with checking condition when there are two subplan-or-hashed subqueries

From: Alexey Bashtanov <bashtanov(at)imap(dot)cc>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: planner weirdness: a join uses nestloop with checking condition when there are two subplan-or-hashed subqueries
Date: 2020-05-22 21:08:22
Message-ID: a25b34f8-f3fe-3a74-044a-3ad5ad6b26ce@imap.cc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Tom,

On 25/02/2020 20:34, Tom Lane wrote:
> cost_qual_eval_walker is not very bright about what to do with
> the AlternativeSubPlan constructs. It looks like it's assuming
> that the non-hashed alternatives will be chosen, which they aren't
> (if they were, this estimate might not be so far out of line).
> But we can't just switch it to make the other assumption, because
> that would skew the results for other cases.

What do you think of making it take both into account?
That's an approximation of a piecewise linear function by a linear one,
so it cannot be very precise, but I think it's better than the current one.

Best, Alex

Attachment Content-Type Size
alternatives-cost-as-geom-mean-v1.patch text/x-patch 3.0 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-05-23 14:21:38 BUG #16456: Implicit unsigned integer truncation at multixact.c:2626
Previous Message Ruslana Akyk 2020-05-22 12:50:43 error