Claudio, > Am I missing something? Yes, prepared statements. This whole issue arises because CE is implemented purely on the planner level. The executor can treat Immutable and Stable functions as the same; the planner cannot, AFAIK. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance