On 2017-04-24 11:46:02 +0300, Konstantin Knizhnik wrote: > So what I am thinking now is implicit query caching. If the same query with > different literal values is repeated many times, then we can try to > generalize this query and replace it with prepared query with > parameters.
That's not actuall all that easy: - You pretty much do parse analysis to be able to do an accurate match. How much overhead is parse analysis vs. planning in your cases? - The invalidation infrastructure for this, if not tied to to fully parse-analyzed statements, is going to be hell. - Migrating to parameters can actually cause significant slowdowns, not nice if that happens implicitly.