From 4bd50068122459ab3e969a807d4312470d1d0b8c Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 7 Jun 2000 02:44:40 +0000 Subject: [PATCH] Add index on pg_index.indrelid for Tom Lane. --- src/backend/catalog/indexing.c | 4 ++-- src/backend/utils/cache/syscache.c | 4 ++-- src/include/catalog/indexing.h | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/backend/catalog/indexing.c b/src/backend/catalog/indexing.c index dd9751d89c..8999812653 100644 --- a/src/backend/catalog/indexing.c +++ b/src/backend/catalog/indexing.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.62 2000/05/30 00:49:42 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.63 2000/06/07 02:44:35 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -45,7 +45,7 @@ char *Name_pg_class_indices[Num_pg_class_indices] = char *Name_pg_group_indices[Num_pg_group_indices] = {GroupNameIndex, GroupSysidIndex}; char *Name_pg_index_indices[Num_pg_index_indices] = -{IndexRelidIndex}; +{IndexRelidIndex, IndexIndrelidIndex}; char *Name_pg_inherits_indices[Num_pg_inherits_indices] = {InheritsRelidSeqnoIndex}; char *Name_pg_language_indices[Num_pg_language_indices] = diff --git a/src/backend/utils/cache/syscache.c b/src/backend/utils/cache/syscache.c index 6cf35fa974..38fa01e0d6 100644 --- a/src/backend/utils/cache/syscache.c +++ b/src/backend/utils/cache/syscache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.51 2000/06/06 17:02:38 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.52 2000/06/07 02:44:37 momjian Exp $ * * NOTES * These routines allow the parser/planner/executor to perform @@ -71,7 +71,7 @@ typedef HeapTuple (*ScanFunc) (); In backend/catalog/indexing.c, initialize the relation array with the index names for the relation, fixed size of relation (or marking first non-fixed length field), and create the index lookup function. - Pick one that takes similar arguments and use that one, but keep the + Pick one that has similar arguments and use that one, but keep the function names in the same order as the cache list for clarity. Finally, any place your relation gets heap_insert() or diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h index 3aea1db0fb..c621bb042e 100644 --- a/src/include/catalog/indexing.h +++ b/src/include/catalog/indexing.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: indexing.h,v 1.37 2000/04/12 17:16:27 momjian Exp $ + * $Id: indexing.h,v 1.38 2000/06/07 02:44:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -28,7 +28,7 @@ #define Num_pg_class_indices 2 #define Num_pg_description_indices 1 #define Num_pg_group_indices 2 -#define Num_pg_index_indices 1 +#define Num_pg_index_indices 2 #define Num_pg_inherits_indices 1 #define Num_pg_language_indices 2 #define Num_pg_listener_indices 1 @@ -58,6 +58,7 @@ #define DescriptionObjIndex "pg_description_objoid_index" #define GroupNameIndex "pg_group_name_index" #define GroupSysidIndex "pg_group_sysid_index" +#define IndexIndrelidIndex "pg_index_indrelid_index" #define IndexRelidIndex "pg_index_indexrelid_index" #define InheritsRelidSeqnoIndex "pg_inherits_relid_seqno_index" #define LanguageNameIndex "pg_language_name_index" @@ -183,6 +184,8 @@ DECLARE_UNIQUE_INDEX(pg_class_relname_index on pg_class using btree(relname name DECLARE_UNIQUE_INDEX(pg_description_objoid_index on pg_description using btree(objoid oid_ops)); DECLARE_UNIQUE_INDEX(pg_group_name_index on pg_group using btree(groname name_ops)); DECLARE_UNIQUE_INDEX(pg_group_sysid_index on pg_group using btree(grosysid int4_ops)); +/* This following index is not used for a cache and is not unique */ +DECLARE_INDEX(pg_index_indrelid_index on pg_index using btree(indrelid oid_ops)); DECLARE_UNIQUE_INDEX(pg_index_indexrelid_index on pg_index using btree(indexrelid oid_ops)); DECLARE_UNIQUE_INDEX(pg_inherits_relid_seqno_index on pg_inherits using btree(inhrelid oid_ops, inhseqno int4_ops)); DECLARE_UNIQUE_INDEX(pg_language_name_index on pg_language using btree(lanname name_ops));