I'm bumping this to the next commitfest because I haven't had a chance to address the questions posed by Dmitry. I'm sure I'll get to it in the next few weeks.
> I believe it would be beneficial to add this potential API extension patch into > the thread (as an example of an interface defining how scanCols could be used) > and review them together.
As for including some code that uses the scanCols, after discussing off-list with a few folks, there are three options I would like to pursue for doing this.
One option I will pursue is using the scanCols to inform the columns needed to be spilled for memory-bounded hashagg (mentioned by Jeff here [1]).
The second is potentially using the scanCols in the context of FDW. Corey, would you happen to have any specific examples handy of when this might be useful?
The third is exercising it with a test only but providing an example of how a table AM API user like Zedstore uses the columns during planning.