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-04-04T19:14:20Z
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 Tue, Apr 1, 2025 at 10:14 PM Richard Guo <guofenglinux@gmail.com> wrote: > The attnotnull catalog information being discussed here is intended > for use during constant folding (and possibly sublink pull-up), which > occurs long before partition pruning. Am I missing something? Hmm, OK, so you think that we need to gather this information early, so that we can do constant folding correctly, but you don't want to gather everything that get_relation_info() does at this stage, because then we're doing extra work on partitions that might later be pruned. Is that correct? > Additionally, I'm doubtful that the collection of relhassubclass can > be moved after partition pruning. How can we determine whether a > relation is inheritable without retrieving its relhassubclass > information? We can't -- but notice that we open the relation before fetching relhassubclass, and then pass down the Relation object to where get_relation_info() is ultimately called, so that we do not repeatedly open and close the Relation. I don't know if I can say exactly what's going to go wrong if we add an extra table_open()/table_close() as you do in the patch, but I've seen enough performance and correctness problems with such code over the years to make me skeptical. -- Robert Haas EDB: http://www.enterprisedb.com