Re: Check each of base restriction clauses for constant-FALSE-or-NULL

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Check each of base restriction clauses for constant-FALSE-or-NULL
Date: 2023-10-10 05:45:31
Message-ID: CAExHW5sPy65jtkR-tBqZm8mjvKg2toFGa1JDvXrE312XKiMFUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 10, 2023 at 11:09 AM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> Do you mean the const-folding? It happens in the preprocessing phase,
> specifically in eval_const_expressions().

Thanks.

> Hm, I don't think so. get_gating_quals is called in createplan.c, where
> we've selected the best path, while the optimization with my code
> happens much earlier, when we set size estimates for a base relation.
> Neither of these two is a duplicate of the other. I think the theory
> here is that it's always a win to mark a rel as dummy if possible as
> early as we can.

Right. Do you have an example where this could be demonstrated?

--
Best Wishes,
Ashutosh Bapat

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2023-10-10 05:49:31 Re: Crash in add_paths_to_append_rel
Previous Message Richard Guo 2023-10-10 05:39:02 Re: Check each of base restriction clauses for constant-FALSE-or-NULL