From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Convert planner's AggInfo and AggTransInfo to Nodes |
Date: | 2022-07-18 16:08:24 |
Message-ID: | 742479.1658160504@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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
Attachment | Content-Type | Size |
---|---|---|
convert-a-couple-of-bare-structs-to-Nodes.patch | text/x-diff | 5.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | vignesh C | 2022-07-18 16:16:37 | Re: Handle infinite recursion in logical replication setup |
Previous Message | Robert Haas | 2022-07-18 16:06:57 | Re: Transparent column encryption |