Obviously I'm actively working on developing and stabilising all this. Some of the things I'm working on are: work_mem accounting, batch increases, rescans and figuring out if the resource management for those BufFiles is going to work. There are quite a lot of edge cases some of which I'm still figuring out, but I feel like this approach is workable. At this stage I want to share what I'm doing to see if others have feedback, ideas, blood curdling screams of horror, etc. I will have better patches and a set of test queries soon. Thanks for reading.
This patch doesn't receive any review. Patch is not applying properly to HEAD.