On Sun, Feb 13, 2022 at 4:55 PM David Rowley <dgrowle...@gmail.com> wrote: > FWIW, that would remove the whole point in init run-time pruning. The > reason I made two phases of run-time pruning was so that we could get > away from having the init plan overhead of nodes we'll never need to > scan. If we wanted to show the (never executed) scans in EXPLAIN then > we'd need to do the init plan part and allocate all that memory > needlessly.
Interesting. I didn't realize that was why it had ended up like this. > I understood at the time it was just the EXPLAIN output that you had > concerns with. I thought that was just around the lack of any display > of the condition we used for pruning. That was part of it, but I did think it was surprising that we didn't print anything at all about the nodes we pruned, too. Although we're technically iterating over the PlanState, from the user perspective it feels like you're asking PostgreSQL to print out the plan - so it seems weird to have nodes in the Plan tree that are quietly omitted from the output. That said, perhaps in retrospect it's good that it ended up as it did, since we'd have a lot of trouble printing anything sensible for a scan of a table that's since been dropped. -- Robert Haas EDB: http://www.enterprisedb.com