diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-01-22 23:50:30 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-01-22 23:50:30 +0000 |
commit | 71ed7eb4941ddb32700a51a8b8b3403eceeca4a9 (patch) | |
tree | e2452e2e308d6066c2c7e255eab5332cfcb4baa8 /src/backend/access/index/indexam.c | |
parent | 78845177bb8839a2a582b92de2b46ce7d3f16df4 (diff) | |
download | postgresql-71ed7eb4941ddb32700a51a8b8b3403eceeca4a9.tar.gz postgresql-71ed7eb4941ddb32700a51a8b8b3403eceeca4a9.zip |
Revise handling of index-type-specific indexscan cost estimation, per
pghackers discussion of 5-Jan-2000. The amopselect and amopnpages
estimators are gone, and in their place is a per-AM amcostestimate
procedure (linked to from pg_am, not pg_amop).
Diffstat (limited to 'src/backend/access/index/indexam.c')
-rw-r--r-- | src/backend/access/index/indexam.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/src/backend/access/index/indexam.c b/src/backend/access/index/indexam.c index dc08d10bc31..3c286f6ec74 100644 --- a/src/backend/access/index/indexam.c +++ b/src/backend/access/index/indexam.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.38 1999/12/30 05:04:50 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/index/indexam.c,v 1.39 2000/01/22 23:50:09 tgl Exp $ * * INTERFACE ROUTINES * index_open - open an index relation by relationId @@ -69,21 +69,6 @@ #include "access/heapam.h" #include "utils/relcache.h" -/* ---------------- - * undefine macros we aren't going to use that would otherwise - * get in our way.. delete is defined in c.h and the am's are - * defined in heapam.h - * ---------------- - */ -#undef delete -#undef aminsert -#undef amdelete -#undef ambeginscan -#undef amrescan -#undef amendscan -#undef ammarkpos -#undef amrestrpos -#undef amgettuple /* ---------------------------------------------------------------- * macros used in index_ routines @@ -359,6 +344,27 @@ index_getnext(IndexScanDesc scan, } /* ---------------- + * index_cost_estimator + * + * Fetch the amcostestimate procedure OID for an index. + * + * We could combine fetching and calling the procedure, + * as index_insert does for example; but that would require + * importing a bunch of planner/optimizer stuff into this file. + * ---------------- + */ +RegProcedure +index_cost_estimator(Relation relation) +{ + RegProcedure procedure; + + RELATION_CHECKS; + GET_REL_PROCEDURE(cost_estimator, amcostestimate); + + return procedure; +} + +/* ---------------- * index_getprocid * * Some indexed access methods may require support routines that are |