From 71ed7eb4941ddb32700a51a8b8b3403eceeca4a9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 22 Jan 2000 23:50:30 +0000 Subject: 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). --- doc/src/sgml/catalogs.sgml | 8 +++----- doc/src/sgml/xindex.sgml | 27 ++++++--------------------- 2 files changed, 9 insertions(+), 26 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index cc28888efeb..d0edf22daa8 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1,6 +1,6 @@ .\" This is -*-nroff-*- .\" XXX standard disclaimer belongs here.... -.\" $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.2 2000/01/11 01:40:04 tgl Exp $ +.\" $Header: /cvsroot/pgsql/doc/src/sgml/catalogs.sgml,v 2.3 2000/01/22 23:50:08 tgl Exp $ .TH "SYSTEM CATALOGS" INTRO 03/13/94 PostgreSQL PostgreSQL .SH "Section 7 - System Catalogs" .de LS @@ -138,6 +138,8 @@ pg_am regproc ambuild /* "build new index" function */ regproc amcreate /* - deprecated */ regproc amdestroy /* - deprecated */ + regproc amcostestimate /* estimate cost of an indexscan */ + .fi .nf M pg_amop @@ -148,10 +150,6 @@ pg_amop oid amopopr /* the operator */ int2 amopstrategy /* traversal/search strategy number to which this operator applies */ - regproc amopselect /* function to calculate the operator - selectivity */ - regproc amopnpages /* function to calculate the number of - pages that will be examined */ .fi .nf M pg_amproc diff --git a/doc/src/sgml/xindex.sgml b/doc/src/sgml/xindex.sgml index 771c30e4858..e4d36e1cc5b 100644 --- a/doc/src/sgml/xindex.sgml +++ b/doc/src/sgml/xindex.sgml @@ -1,5 +1,5 @@ @@ -403,20 +403,9 @@ CREATE OPERATOR = ( the oids of the operators for the opclass (which we'll get in just a minute) - - amopselect, amopnpages - cost functions - - - The cost functions are used by the query optimizer to decide whether or - not to use a given index in a scan. Fortunately, these already exist. - The two functions we'll use are btreesel, which - estimates the selectivity of the B-tree, and - btreenpage, which estimates the number of pages a - search will touch in the tree. @@ -460,10 +449,8 @@ CREATE OPERATOR = ( equal, in pg_amop. We add the instances we need: - INSERT INTO pg_amop (amopid, amopclaid, amopopr, amopstrategy, - amopselect, amopnpages) - SELECT am.oid, opcl.oid, c.opoid, 1, - 'btreesel'::regproc, 'btreenpage'::regproc + INSERT INTO pg_amop (amopid, amopclaid, amopopr, amopstrategy) + SELECT am.oid, opcl.oid, c.opoid, 1 FROM pg_am am, pg_opclass opcl, complex_abs_ops_tmp c WHERE amname = 'btree' AND opcname = 'complex_abs_ops' AND @@ -519,13 +506,11 @@ CREATE OPERATOR = ( Now we need to add a hashing strategy to allow the type to be indexed. - We do this by using another type in pg_am but we reuse the sames ops. + We do this by using another type in pg_am but we reuse the same ops. - INSERT INTO pg_amop (amopid, amopclaid, amopopr, amopstrategy, - amopselect, amopnpages) - SELECT am.oid, opcl.oid, c.opoid, 1, - 'hashsel'::regproc, 'hashnpage'::regproc + INSERT INTO pg_amop (amopid, amopclaid, amopopr, amopstrategy) + SELECT am.oid, opcl.oid, c.opoid, 1 FROM pg_am am, pg_opclass opcl, complex_abs_ops_tmp c WHERE amname = 'hash' AND opcname = 'complex_abs_ops' AND -- cgit v1.2.3