0:00 2001
From: Andy Fan
Date: Sun, 9 Oct 2022 17:47:23 +0800
Subject: [PATCH v1] 2 methods for Pulling up direct-correlated ANY_SUBLINK
---
.../postgres_fdw/expected/postgres_fdw.out| 24 +-
src/backend/optimizer/plan/subselect.c| 7 +-
src/backend/optimizer/prep/prepjointr
On Tue, Sep 10, 2019 at 9:49 PM Tom Lane wrote:
> > Can we try to pull up direct-correlated ANY SubLink with the help of
> > LATERAL?
>
> Perhaps. But what's the argument that you'd end up with a better
> plan? LATERAL pretty much constrains things to use a nestloop,
> so I'm not sure there's a
On Tue, Sep 17, 2019 at 4:41 PM Richard Guo wrote:
>
> On Thu, Sep 12, 2019 at 11:35 PM Antonin Houska wrote:
>
>> Richard Guo wrote:
>>
>> > On Wed, Sep 11, 2019 at 3:25 PM Antonin Houska
>> > wrote:
>> >
>> >
>> > Nevertheless, I don't know how to overcome the problems that I
>> > me
On Thu, Sep 12, 2019 at 11:35 PM Antonin Houska wrote:
> Richard Guo wrote:
>
> > On Wed, Sep 11, 2019 at 3:25 PM Antonin Houska
> > wrote:
> >
> >
> > Nevertheless, I don't know how to overcome the problems that I
> > mentioned
> > upthread.
> >
> >
> > Do you mean the problem "the
Richard Guo wrote:
> On Wed, Sep 11, 2019 at 3:25 PM Antonin Houska
> wrote:
>
>
> Nevertheless, I don't know how to overcome the problems that I
> mentioned
> upthread.
>
>
> Do you mean the problem "the WHERE clause of the subquery didn't
> participate in the SEMI JOIN evalu
Hi Tom,
On Tue, Sep 10, 2019 at 9:48 PM Tom Lane wrote:
>
> > Can we try to pull up direct-correlated ANY SubLink with the help of
> > LATERAL?
>
> Perhaps. But what's the argument that you'd end up with a better
> plan? LATERAL pretty much constrains things to use a nestloop,
> so I'm not sur
Hi Antonin,
On Wed, Sep 11, 2019 at 3:25 PM Antonin Houska wrote:
>
> Nevertheless, I don't know how to overcome the problems that I mentioned
> upthread.
>
Do you mean the problem "the WHERE clause of the subquery didn't
participate in the SEMI JOIN evaluation"? Good news is it has been fixed
Tom Lane wrote:
> > Can we try to pull up direct-correlated ANY SubLink with the help of
> > LATERAL?
>
> Perhaps. But what's the argument that you'd end up with a better
> plan? LATERAL pretty much constrains things to use a nestloop,
> so I'm not sure there's anything fundamentally different
Hi Antonin,
On Tue, Sep 10, 2019 at 4:31 PM Antonin Houska wrote:
> Richard Guo wrote:
>
> > Can we try to pull up direct-correlated ANY SubLink with the help of
> > LATERAL?
>
> > By this way, we can convert the query:
> >
> > select * from a where a.i = ANY(select i from b where a.j > b.j);
>
Richard Guo writes:
> Currently we do not try to pull up sub-select of type ANY_SUBLINK if it
> refers to any Vars of the parent query, as indicated in the code snippet
> below:
> if (contain_vars_of_level((Node *) subselect, 1))
> return NULL;
> Why do we have this check?
Because the
Richard Guo wrote:
> Can we try to pull up direct-correlated ANY SubLink with the help of
> LATERAL?
> By this way, we can convert the query:
>
> select * from a where a.i = ANY(select i from b where a.j > b.j);
>
> To:
>
> select * from a SEMI JOIN lateral(select * from b where a.j > b.j)
>
Hi,
Currently we do not try to pull up sub-select of type ANY_SUBLINK if it
refers to any Vars of the parent query, as indicated in the code snippet
below:
JoinExpr *
convert_ANY_sublink_to_join(PlannerInfo *root, SubLink *sublink,
Relids available_rels)
{
...
12 matches
Mail list logo