Re: Reduce "Var IS [NOT] NULL" quals during constant folding
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, David Rowley <dgrowleyml@gmail.com>, Tender Wang <tndrwang@gmail.com>,
Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-05-22T14:14:34Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix misuse of Relids for storing attribute numbers
- 2d756ebbe857 19 (unreleased) landed
-
Reduce "Var IS [NOT] NULL" quals during constant folding
- e2debb64380e 19 (unreleased) landed
-
Centralize collection of catalog info needed early in the planner
- 904f6a593a06 19 (unreleased) landed
-
Expand virtual generated columns before sublink pull-up
- e0d05295268e 19 (unreleased) landed
-
Expand virtual generated columns in the planner
- 1e4351af329f 18.0 cited
On Thu, May 1, 2025 at 4:33 AM Richard Guo <guofenglinux@gmail.com> wrote: > Here is the patchset that implements this optimization. 0001 moves > the expansion of virtual generated columns to occur before sublink > pull-up. 0002 introduces a new function, preprocess_relation_rtes, > which scans the rangetable for relation RTEs and performs inh flag > updates and virtual generated column expansion in a single loop, so > that only one table_open/table_close call is required for each > relation. 0003 collects NOT NULL attribute information for each > relation within the same loop, stores it in a relation OID based hash > table, and uses this information to reduce NullTest quals during > constant folding. > > I think the code now more closely resembles the phase 1 and phase 2 > described earlier: it collects all required early-stage catalog > information within a single loop over the rangetable, allowing each > relation to be opened and closed only once. It also avoids the > has_subclass() call along the way. Before we commit to something along these lines, I think we need to understand whether Tom intends to press Peter for some bigger change around expand_virtual_generated_columns. If Tom doesn't respond right away, I suggest that we need to add an open item for http://postgr.es/m/602561.1744314879@sss.pgh.pa.us -- Robert Haas EDB: http://www.enterprisedb.com