diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-07 22:40:49 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-07 22:40:49 +0000 |
commit | 445ce15702f701423a0fed3defe3a43662c7cd8d (patch) | |
tree | f2b79c75d8be22098f0f7c093127b133755de22a /src/include | |
parent | 12dcf7bb7552386c7a18d8a30b176718eb51c00e (diff) |
Create a third option named "partition" for constraint_exclusion, and make it
the default. This setting enables constraint exclusion checks only for
appendrel members (ie, inheritance children and UNION ALL arms), which are
the cases in which constraint exclusion is most likely to be useful. Avoiding
the overhead for simple queries that are unlikely to benefit should bring
the cost down to the point where this is a reasonable default setting.
Per today's discussion.
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/optimizer/cost.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h index 39ece8f4ff7..27600fa1acc 100644 --- a/src/include/optimizer/cost.h +++ b/src/include/optimizer/cost.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.95 2009/01/01 17:24:00 momjian Exp $ + * $PostgreSQL: pgsql/src/include/optimizer/cost.h,v 1.96 2009/01/07 22:40:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -29,6 +29,13 @@ #define DEFAULT_EFFECTIVE_CACHE_SIZE 16384 /* measured in pages */ +typedef enum +{ + CONSTRAINT_EXCLUSION_OFF, /* do not use c_e */ + CONSTRAINT_EXCLUSION_ON, /* apply c_e to all rels */ + CONSTRAINT_EXCLUSION_PARTITION /* apply c_e to otherrels only */ +} ConstraintExclusionType; + /* * prototypes for costsize.c @@ -52,7 +59,7 @@ extern bool enable_hashagg; extern bool enable_nestloop; extern bool enable_mergejoin; extern bool enable_hashjoin; -extern bool constraint_exclusion; +extern int constraint_exclusion; extern double clamp_row_est(double nrows); extern double index_pages_fetched(double tuples_fetched, BlockNumber pages, |