On Fri, Nov 21, 2008 at 09:55:11AM +0200, WireSpot wrote:
> What would make it all the way better was if the database would do
> that last step for you as well: automatically recognize statements
> that do the same thing and return the already existing handle.
This is somewhat difficult; things to consider are different data
distributions (i.e. the optimal plan changes depending on if you're
searching for common vs. rare values) changes to schema (table foo and
bar are now called the opposite) and various other issues. It would of
course be possible for PG to do this, it's just getting it all correct
and it being a win in the common case is difficult.
Sam