Convert planner's AggInfo and AggTransInfo to Nodes
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Date: 2022-07-18T16:08:24Z
Lists: pgsql-hackers
Attachments
- convert-a-couple-of-bare-structs-to-Nodes.patch (text/x-diff) patch
I got annoyed just now upon finding that pprint() applied to the planner's "root" pointer doesn't dump root->agginfos or root->aggtransinfos. That's evidently because AggInfo and AggTransInfo aren't proper Nodes, just bare structs, which presumably is because somebody couldn't be bothered to write outfuncs support for them. I'd say that was a questionable shortcut even when it was made, and there's certainly precious little excuse now that gen_node_support.pl can do all the heavy lifting. Hence, PFA a little finger exercise to turn them into Nodes. I took the opportunity to improve related comments too, and in particular to fix some comments that leave the impression that preprocess_minmax_aggregates still does its own scan of the query tree. (It was momentary confusion over that idea that got me to the point of being annoyed in the first place.) Any objections so far? I'm kind of tempted to mount an effort to get rid of as many of pathnodes.h's "read_write_ignore" annotations as possible. Some are necessary to prevent infinite recursion, and others represent considered judgments that they'd bloat node dumps more than they're worth --- but I think quite a lot of them arose from plain laziness about updating outfuncs.c. With the infrastructure we have now, that's no longer a good reason. In particular, I'm tempted to make a dump of PlannerInfo include all the baserel RelOptInfos (not joins though; there could be a mighty lot of those.) I think we didn't print the simple_rel_array[] array before mostly because outfuncs didn't use to have reasonable support for printing arrays. Thoughts? regards, tom lane
Commits
-
Dump more fields when dumping planner internal data structures.
- af119e08fd14 16.0 landed
-
Make serialization of Nodes' scalar-array fields more robust.
- 2d04277121f2 16.0 landed
-
Convert planner's AggInfo and AggTransInfo structs to proper Nodes.
- d6a3aeb9a37b 16.0 landed