Re: Planner making bad choice in alternative subplan decision - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Planner making bad choice in alternative subplan decision
Date
Msg-id 475466.1601334537@sss.pgh.pa.us
Whole thread Raw
In response to Re: Planner making bad choice in alternative subplan decision  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Planner making bad choice in alternative subplan decision  (David Rowley <dgrowleyml@gmail.com>)
Re: Planner making bad choice in alternative subplan decision  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
David Rowley <dgrowleyml@gmail.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



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Planner making bad choice in alternative subplan decision
Next
From: Andy Fan
Date:
Subject: Re: Partition prune with stable Expr