Skip to content

Commit 6e2e12c

Browse files
committed
Remove overly-pessimistic statement about constraint exclusion.
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.
1 parent b33f611 commit 6e2e12c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/src/sgml/ddl.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2975,11 +2975,11 @@ ANALYZE measurement;
29752975
<listitem>
29762976
<para>
29772977
Constraint exclusion only works when the query's <literal>WHERE</>
2978-
clause contains constants. A parameterized query will not be
2979-
optimized, since the planner cannot know which partitions the
2980-
parameter value might select at run time. For the same reason,
2981-
<quote>stable</> functions such as <function>CURRENT_DATE</function>
2982-
must be avoided.
2978+
clause contains constants (or externally supplied parameters).
2979+
For example, a comparison against a non-immutable function such as
2980+
<function>CURRENT_TIMESTAMP</function> cannot be optimized, since the
2981+
planner cannot know which partition the function value might fall
2982+
into at run time.
29832983
</para>
29842984
</listitem>
29852985

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy