Re: Unwanted expression simplification in PG12b2 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Unwanted expression simplification in PG12b2
Date
Msg-id CA+TgmobyFoj3dy+mLbdp_51HG00V=3CbjPBk9sM84U1actC=7Q@mail.gmail.com
Whole thread Raw
In response to Re: Unwanted expression simplification in PG12b2  ("Finnerty, Jim" <jfinnert@amazon.com>)
List pgsql-hackers
On Mon, Sep 23, 2019 at 9:20 PM Finnerty, Jim <jfinnert@amazon.com> wrote:
> If the function was moved to the FROM clause where it would be executed as a lateral cross join instead of a target
listexpression, how would this affect the cost-based positioning of the Gather?
 

I think you'd end up turning what is now a Seq Scan into a Nested Loop
with a Seq Scan on one side. I think the computation of the target
list would be done by the Function Scan or Result node on the other
side of the Nested Loop, and couldn't move anywhere else. The planner
would consider putting the Gather either on top of the Nested Loop or
on top of the Seq Scan, and the former would probably win. So I think
this would give the desired behavior, but I haven't thought about it
very hard.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: [HACKERS] advanced partition matching algorithm forpartition-wise join
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL12 and older versions of OpenSSL