mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
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).
This commit is contained in:
@@ -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
|
||||
@@ -358,6 +343,27 @@ index_getnext(IndexScanDesc scan,
|
||||
return result;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* 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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user