On Wed, 6 Nov 2024 at 12:09, Tom Lane <tgl@xxxxxxxxxxxxx> wrote: > Of course, I might be overestimating the performance benefit we'd get. > But I'm tempted to give it a try. I'm glad. I'm curious to see if you're right about the projection overhead of the flags. If you're right, it seems like a not too difficult optimisation to get in. I like the idea as it also gets rid of the flag cruft from prepunion.c, which saves having to add flags conditionally if INTERCEPT/EXCEPT were ever made to use joins. David