On Thu, 8 Apr 2021 at 15:32, Amit Langote <amitlangot...@gmail.com> wrote: > There's 10-20% improvement in this case too for various partition > counts, which really has more to do with 86dc90056 than the work done > here.
I'm not sure of the exact query you're running, but I imagine the reason that it wasn't that slow with custom plans was down to 428b260f87. So the remaining slowness for the generic plan case with large numbers of partitions in the plan vs custom plans plan-time pruning is a) locking run-time pruned partitions; and; b) permission checks during executor startup? Aside from the WCO and RETURNING stuff you mentioned, I mean. David