On Tue, May 20, 2025 at 11:38 AM Tom Lane <t...@sss.pgh.pa.us> wrote: > I still like the core idea of deferring locking, but I don't like > anything about this implementation of it. It seems like there has > to be a better and simpler way.
Without particularly defending this implementation, and certainly without defending its bugs, I just want to say that I'm not convinced by the idea that there has to be a better and simpler way. We -- principally Amit, but also me and you and others -- have been trying to find the best way of doing this for probably 5 years now. If you do something during executor startup, you have to be prepared for executor startup to force a replan, and if you do something before executor startup, then you're duplicating executor logic into a new phase that needs to communicate its results forward to execution proper. Either approach is awkward and that awkwardness seems to inevitably bleed into the plan cache specifically. I'd be beyond delighted if you want to help chart a path through the awkwardness here, since you know this stuff better than anybody, but I am skeptical that there is a truly marvelous approach which we've just managed to overlook for all this time. -- Robert Haas EDB: http://www.enterprisedb.com