Re: Planner making bad choice in alternative subplan decision

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Planner making bad choice in alternative subplan decision
Date: 2020-09-28 23:08:57
Message-ID: 475466.1601334537@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Rowley <dgrowleyml(at)gmail(dot)com> writes:
> Any opinions on this?

This patch scares the heck out of me. It's a pretty much unprincipled
change in a fundamental selectivity estimator, which is going to affect
all sorts of queries not only the particular case you have in mind.
There's no reason to think that the outcome will be positive for other
cases, either.

The idea I'd had was to adjust make_subplan and cost_subplan to estimate
EXIST cases on the basis of either 50% retrieval (same as ANY/ALL) or
maybe full retrieval if you want to be pessimistic. I've not had time
to try it out though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andy Fan 2020-09-28 23:13:00 Re: Partition prune with stable Expr
Previous Message David Rowley 2020-09-28 22:47:34 Re: Planner making bad choice in alternative subplan decision