diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2016-03-23 23:01:35 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2016-03-23 23:01:35 -0300 |
commit | 473b93287040b20017cc25a157cffdc5b978c254 (patch) | |
tree | 58f662a65247525b2e5e178b9050feb3f3056590 /src/backend/utils/adt/selfuncs.c | |
parent | 2c6af4f44228d76d3351fe26f68b00b55cdd239a (diff) | |
download | postgresql-473b93287040b20017cc25a157cffdc5b978c254.tar.gz postgresql-473b93287040b20017cc25a157cffdc5b978c254.zip |
Support CREATE ACCESS METHOD
This enables external code to create access methods. This is useful so
that extensions can add their own access methods which can be formally
tracked for dependencies, so that DROP operates correctly. Also, having
explicit support makes pg_dump work correctly.
Currently only index AMs are supported, but we expect different types to
be added in the future.
Authors: Alexander Korotkov, Petr Jelínek
Reviewed-By: Teodor Sigaev, Petr Jelínek, Jim Nasby
Commitfest-URL: https://commitfest.postgresql.org/9/353/
Discussion: https://www.postgresql.org/message-id/CAPpHfdsXwZmojm6Dx+TJnpYk27kT4o7Ri6X_4OSWcByu1Rm+VA@mail.gmail.com
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index d396ef142f9..b2c57e87a5e 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -6013,21 +6013,7 @@ string_to_bytea_const(const char *str, size_t str_len) *------------------------------------------------------------------------- */ -/* - * deconstruct_indexquals is a simple function to examine the indexquals - * attached to a proposed IndexPath. It returns a list of IndexQualInfo - * structs, one per qual expression. - */ -typedef struct -{ - RestrictInfo *rinfo; /* the indexqual itself */ - int indexcol; /* zero-based index column number */ - bool varonleft; /* true if index column is on left of qual */ - Oid clause_op; /* qual's operator OID, if relevant */ - Node *other_operand; /* non-index operand of qual's operator */ -} IndexQualInfo; - -static List * +List * deconstruct_indexquals(IndexPath *path) { List *result = NIL; @@ -6177,35 +6163,7 @@ orderby_operands_eval_cost(PlannerInfo *root, IndexPath *path) return qual_arg_cost; } -/* - * genericcostestimate is a general-purpose estimator that can be used for - * most index types. In some cases we use genericcostestimate as the base - * code and then incorporate additional index-type-specific knowledge in - * the type-specific calling function. To avoid code duplication, we make - * genericcostestimate return a number of intermediate values as well as - * its preliminary estimates of the output cost values. The GenericCosts - * struct includes all these values. - * - * Callers should initialize all fields of GenericCosts to zero. In addition, - * they can set numIndexTuples to some positive value if they have a better - * than default way of estimating the number of leaf index tuples visited. - */ -typedef struct -{ - /* These are the values the cost estimator must return to the planner */ - Cost indexStartupCost; /* index-related startup cost */ - Cost indexTotalCost; /* total index-related scan cost */ - Selectivity indexSelectivity; /* selectivity of index */ - double indexCorrelation; /* order correlation of index */ - - /* Intermediate values we obtain along the way */ - double numIndexPages; /* number of leaf pages visited */ - double numIndexTuples; /* number of leaf tuples visited */ - double spc_random_page_cost; /* relevant random_page_cost value */ - double num_sa_scans; /* # indexscans from ScalarArrayOps */ -} GenericCosts; - -static void +void genericcostestimate(PlannerInfo *root, IndexPath *path, double loop_count, |