Re: Condition pushdown: why (=) is pushed down into join, but BETWEEN or >= is not?

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dmitry Astapov <dastapov(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Condition pushdown: why (=) is pushed down into join, but BETWEEN or >= is not?
Date: 2022-02-21 07:46:07
Message-ID: CAKU4AWph8k9QdDGtnQAZoGb2HawbPBEZQvv8xcZMZ3mZez-hjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
> >> It actually deals with a more general form of this case, because the
> >> clauses don't need to reference the same attribute - so for example this
> >> would work too, assuming there is extended stats object on the columns
> >> on each side:
> >>
> >> P(A.c = B.d | (A.e < 42) & (B.f < 42))
> >
> > That'd be cool.
> >
>
> Yeah, but the patch implementing this still needs more work.
>
>
Thanks for that patch. That patch has been on my study list for a long
time and it can fix the other real case I met some day ago. I spent one
day studying it again yesterday just that the result does not deserve
sharing at the current stage. As for the purpose here, if we have
extended statistics, I believe it can work well. But requiring extended
statistics for this feature does not look very reasonable to me. Do you
think we can go further in direction for the issue here? and it would
be super great that you can take a look at the commit 3 [1]. IIUC,
It can solve the issue and is pretty straightforward.

[1]
https://www.postgresql.org/message-id/CAKU4AWrdeQZ8xvf%3DDVhndUs%3DRGn8oVoSJvYK3Yj7uWq2%3Ddt%3DMg%40mail.gmail.com

--
Best Regards
Andy Fan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-02-21 07:48:06 Re: Design of pg_stat_subscription_workers vs pgstats
Previous Message kato-sho@fujitsu.com 2022-02-21 07:41:58 RE: Synchronizing slots from primary to standby