Remove overly-pessimistic statement about constraint exclusion.
authorTom Lane
Thu, 23 Aug 2012 03:55:34 +0000 (23:55 -0400)
committerTom Lane
Thu, 23 Aug 2012 03:55:57 +0000 (23:55 -0400)
As of 9.2, constraint exclusion should work okay with prepared statements:
the planner will try custom plans with actual values of the parameters,
and observe that they are a lot cheaper than the generic plan, and thus
never fall back to using the generic plan.  Noted by Tatsuhito Kasahara.

doc/src/sgml/ddl.sgml

index ea840fb8468f7d1d65b572d9880d74dd0178e143..e52dff2dd52bd2f16be34214ef7481fdf2630416 100644 (file)
@@ -2964,11 +2964,11 @@ ANALYZE measurement;
     
      
       Constraint exclusion only works when the query's WHERE
-      clause contains constants.  A parameterized query will not be
-      optimized, since the planner cannot know which partitions the
-      parameter value might select at run time.  For the same reason,
-      stable functions such as CURRENT_DATE
-      must be avoided.
+      clause contains constants (or externally supplied parameters).
+      For example, a comparison against a non-immutable function such as
+      CURRENT_TIMESTAMP cannot be optimized, since the
+      planner cannot know which partition the function value might fall
+      into at run time.