diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/catalog/catversion.h | 4 | ||||
-rw-r--r-- | src/include/catalog/pg_proc.h | 4 | ||||
-rw-r--r-- | src/include/utils/selfuncs.h | 28 |
3 files changed, 28 insertions, 8 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index b92cc0ab059..ff44afe9092 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.325 2006/04/26 18:30:10 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.326 2006/04/26 22:33:13 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200604261 +#define CATALOG_VERSION_NO 200604262 #endif diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 53bcf3f4e36..43c87f36477 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.407 2006/04/26 18:28:30 momjian Exp $ + * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.408 2006/04/26 22:33:17 momjian Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -3812,8 +3812,6 @@ DATA(insert OID = 2591 ( gist_circle_consistent PGNSP PGUID 12 f f t f i 3 16 " DESCR("GiST support"); DATA(insert OID = 2592 ( gist_circle_compress PGNSP PGUID 12 f f t f i 1 2281 "2281" _null_ _null_ _null_ gist_circle_compress - _null_ )); DESCR("GiST support"); -DATA(insert OID = 2599 ( parentsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" _null_ _null_ _null_ parentsel - _null_ )); -DESCR("enhanced restriction selectivity for ltree isparent comparison operators"); /* diff --git a/src/include/utils/selfuncs.h b/src/include/utils/selfuncs.h index df28d738433..ad484d8b492 100644 --- a/src/include/utils/selfuncs.h +++ b/src/include/utils/selfuncs.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/selfuncs.h,v 1.29 2006/04/26 18:28:34 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/selfuncs.h,v 1.30 2006/04/26 22:33:36 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -16,6 +16,7 @@ #define SELFUNCS_H #include "fmgr.h" +#include "access/htup.h" #include "nodes/relation.h" @@ -62,6 +63,26 @@ } while (0) +/* Return data from examine_variable and friends */ +typedef struct +{ + Node *var; /* the Var or expression tree */ + RelOptInfo *rel; /* Relation, or NULL if not identifiable */ + HeapTuple statsTuple; /* pg_statistic tuple, or NULL if none */ + /* NB: if statsTuple!=NULL, it must be freed when caller is done */ + Oid vartype; /* exposed type of expression */ + Oid atttype; /* type to pass to get_attstatsslot */ + int32 atttypmod; /* typmod to pass to get_attstatsslot */ + bool isunique; /* true if matched to a unique index */ +} VariableStatData; + +#define ReleaseVariableStats(vardata) \ + do { \ + if (HeapTupleIsValid((vardata).statsTuple)) \ + ReleaseSysCache((vardata).statsTuple); \ + } while(0) + + typedef enum { Pattern_Type_Like, Pattern_Type_Like_IC, @@ -133,7 +154,8 @@ extern Selectivity estimate_hash_bucketsize(PlannerInfo *root, Node *hashkey, extern Datum btcostestimate(PG_FUNCTION_ARGS); extern Datum hashcostestimate(PG_FUNCTION_ARGS); extern Datum gistcostestimate(PG_FUNCTION_ARGS); - -extern Datum parentsel(PG_FUNCTION_ARGS); +extern bool get_restriction_variable(PlannerInfo *root, List *args, int varRelid, + VariableStatData *vardata, Node **other, + bool *varonleft); #endif /* SELFUNCS_H */ |