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: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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: 2021-05-17 02:52:22
Message-ID: CAKU4AWr362Hz1MEGeN_hsqjgwQRX7KUyPXQw_tPT-KETToGMKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
> So now you have to figure out
> what the selectivity of that is after the application of the partially
> redundant IN clauses.
>

Would marking the new added RestrictInfo.norm_selec > 1 be OK?

clause_selectivity_ext

/*
* If the clause is marked redundant, always return 1.0.
*/
if (rinfo->norm_selec > 1)
return (Selectivity) 1.0;

--
Best Regards
Andy Fan (https://www.aliyun.com/)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2021-05-17 03:06:28 Re: PG 14 release notes, first draft
Previous Message Bruce Momjian 2021-05-17 02:51:02 Re: PG 14 release notes, first draft