1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-21 00:42:43 +03:00

Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions in

pgsql-hackers.  pg_opclass now has a row for each opclass supported by each
index AM, not a row for each opclass name.  This allows pg_opclass to show
directly whether an AM supports an opclass, and furthermore makes it possible
to store additional information about an opclass that might be AM-dependent.
pg_opclass and pg_amop now store "lossy" and "haskeytype" information that we
previously expected the user to remember to provide in CREATE INDEX commands.
Lossiness is no longer an index-level property, but is associated with the
use of a particular operator in a particular index opclass.

Along the way, IndexSupportInitialize now uses the syscaches to retrieve
pg_amop and pg_amproc entries.  I find this reduces backend launch time by
about ten percent, at the cost of a couple more special cases in catcache.c's
IndexScanOK.

Initial work by Oleg Bartunov and Teodor Sigaev, further hacking by Tom Lane.

initdb forced.
This commit is contained in:
Tom Lane
2001-08-21 16:36:06 +00:00
parent c2d1566912
commit f933766ba7
60 changed files with 1918 additions and 1929 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.141 2001/08/16 20:38:55 tgl Exp $
* $Id: parsenodes.h,v 1.142 2001/08/21 16:36:06 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -500,7 +500,6 @@ typedef struct IndexStmt
char *relname; /* name of relation to index on */
char *accessMethod; /* name of access method (eg. btree) */
List *indexParams; /* a list of IndexElem */
List *withClause; /* a list of DefElem */
Node *whereClause; /* qualification (partial-index predicate) */
List *rangetable; /* range table for qual, filled in by
* transformStmt() */

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: relation.h,v 1.57 2001/06/05 05:26:05 tgl Exp $
* $Id: relation.h,v 1.58 2001/08/21 16:36:06 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -183,7 +183,7 @@ typedef struct RelOptInfo
* tuples - number of index tuples in index
* ncolumns - number of columns in index
* nkeys - number of keys used by index (input columns)
* classlist - List of PG_AMOPCLASS OIDs for the index
* classlist - List of PG_OPCLASS OIDs for the index
* indexkeys - List of base-relation attribute numbers that are index keys
* ordering - List of PG_OPERATOR OIDs which order the indexscan result
* relam - the OID of the pg_am of the index
@@ -191,7 +191,6 @@ typedef struct RelOptInfo
* indproc - OID of the function if a functional index, else 0
* indpred - index predicate if a partial index, else NULL
* unique - true if index is unique
* lossy - true if index is lossy (may return non-matching tuples)
*
* ncolumns and nkeys are the same except for a functional index,
* wherein ncolumns is 1 (the single function output) while nkeys
@@ -227,7 +226,6 @@ typedef struct IndexOptInfo
Oid indproc; /* if a functional index */
List *indpred; /* if a partial index */
bool unique; /* if a unique index */
bool lossy; /* if a lossy index */
} IndexOptInfo;
/*