Re: Patch to support SEMI and ANTI join removal - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Patch to support SEMI and ANTI join removal
Date
Msg-id 1976.1411915316@sss.pgh.pa.us
Whole thread Raw
In response to Re: Patch to support SEMI and ANTI join removal  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Patch to support SEMI and ANTI join removal
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> Please correct anything that sounds wrong here, but my understanding is
> that we'll always plan a query right before we execute it, with the
> exception of PREPARE statements where PostgreSQL will cache the query plan
> when the prepare statement is first executed.

If this optimization only works in that scenario, it's dead in the water,
because that assumption is unsupportable.  The planner does not in general
use the same query snapshot as the executor, so even in an immediate-
execution workflow there could have been data changes (caused by other
transactions) between planning and execution.

Why do you need such an assumption?
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proper query implementation for Postgresql driver
Next
From: Shay Rojansky
Date:
Subject: Re: Proper query implementation for Postgresql driver