Qingqing Zhou wrote:
> So is this change the preparation work of caching query plans? Like cleaning
> the plans so they could be well shared?
Yeah, it is somewhat related to the centralized plan caching module that
Tom and I have been discussing in the "cached plan invalidation" thread.
When a cached plan has become invalidated, we want to re-run the planner
on the original Query that has been saved away. If the planner modifies
its input, that means we need to copy the Query it before passing it to
the planner. While that is trivial to do, it is enough of an ugly hack
that I decided to sit down and fix this problem before doing the rest of
the cached plan invalidation work. Hopefully I haven't bitten off more
than I can chew, so to speak :)
-Neil