1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Reverse out cache changes that are not ready yet.

This commit is contained in:
Bruce Momjian
1999-07-20 17:14:08 +00:00
parent 7944d501f4
commit c175de56dc
5 changed files with 84 additions and 180 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.86 1999/07/20 16:48:54 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.87 1999/07/20 17:14:05 momjian Exp $
*
*
* INTERFACE ROUTINES
@@ -52,23 +52,26 @@
/* non-export function prototypes */
static Oid GetHeapRelationOid(char *heapRelationName, char *indexRelationName,
bool istemp);
bool istemp);
static TupleDesc BuildFuncTupleDesc(FuncIndexInfo *funcInfo);
static TupleDesc ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
List *attributeList, int numatts, AttrNumber *attNums);
List *attributeList,
int numatts, AttrNumber *attNums);
static void ConstructIndexReldesc(Relation indexRelation, Oid amoid);
static Oid UpdateRelationRelation(Relation indexRelation, char *temp_relname);
static void InitializeAttributeOids(Relation indexRelation,
int numatts, Oid indexoid);
static void AppendAttributeTuples(Relation indexRelation, int numatts);
int numatts,
Oid indexoid);
static void
AppendAttributeTuples(Relation indexRelation, int numatts);
static void UpdateIndexRelation(Oid indexoid, Oid heapoid,
FuncIndexInfo *funcInfo, int natts,
AttrNumber *attNums, Oid *classOids, Node *predicate,
List *attributeList, bool islossy, bool unique, bool primary);
FuncIndexInfo *funcInfo, int natts,
AttrNumber *attNums, Oid *classOids, Node *predicate,
List *attributeList, bool islossy, bool unique, bool primary);
static void DefaultBuild(Relation heapRelation, Relation indexRelation,
int numberOfAttributes, AttrNumber *attributeNumber,
IndexStrategy indexStrategy, uint16 parameterCount,
int numberOfAttributes, AttrNumber *attributeNumber,
IndexStrategy indexStrategy, uint16 parameterCount,
Datum *parameter, FuncIndexInfoPtr funcInfo, PredInfo *predInfo);
/* ----------------------------------------------------------------

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.41 1999/07/20 16:48:54 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.42 1999/07/20 17:14:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -28,29 +28,38 @@
/*
* Names of indices on the following system catalogs:
*
* pg_attribute
* pg_proc
* pg_type
* pg_naming
* pg_class
* pg_attrdef
* pg_relcheck
* pg_trigger
*/
char *Name_pg_amop_indices[Num_pg_amop_indices] = {AccessMethodOpidIndex,
AccessMethodStrategyIndex};
char *Name_pg_attr_indices[Num_pg_attr_indices] = {AttributeNameIndex,
AttributeNumIndex, AttributeRelidIndex};
char *Name_pg_index_indices[Num_pg_index_indices] = {IndexRelidIndex};
AttributeNumIndex,
AttributeRelidIndex};
char *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndex,
ProcedureOidIndex, ProcedureSrcIndex};
ProcedureOidIndex,
ProcedureSrcIndex};
char *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndex,
TypeOidIndex};
TypeOidIndex};
char *Name_pg_class_indices[Num_pg_class_indices] = {ClassNameIndex,
ClassOidIndex};
ClassOidIndex};
char *Name_pg_attrdef_indices[Num_pg_attrdef_indices] = {AttrDefaultIndex};
char *Name_pg_relcheck_indices[Num_pg_relcheck_indices] = {RelCheckIndex};
char *Name_pg_trigger_indices[Num_pg_trigger_indices] = {TriggerRelidIndex};
char *Name_pg_description_indices[Num_pg_description_indices] = {DescriptionObjIndex};
static HeapTuple CatalogIndexFetchTuple(Relation heapRelation,
Relation idesc, ScanKey skey, int16 num_keys);
Relation idesc,
ScanKey skey,
int16 num_keys);
/*
@@ -243,89 +252,12 @@ CatalogIndexFetchTuple(Relation heapRelation,
}
/*---------------------------------------------------------------------
* Class-specific index lookups
*---------------------------------------------------------------------
*/
/*
* The remainder of the file is for individual index scan routines. Each
* index should be scanned according to how it was defined during bootstrap
* (that is, functional or normal) and what arguments the cache lookup
* requires. Each routine returns the heap tuple that qualifies.
*/
HeapTuple
AccessMethodOpidIndexScan(Relation heapRelation,
Oid claid,
Oid opopr,
Oid opid)
{
Relation idesc;
ScanKeyData skey[3];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(claid));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(AttrNumber) 2,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(opopr));
ScanKeyEntryInitialize(&skey[2],
(bits16) 0x0,
(AttrNumber) 3,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(opid));
idesc = index_openr(AccessMethodOpidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
index_close(idesc);
return tuple;
}
HeapTuple
AccessMethodStrategyIndexScan(Relation heapRelation,
Oid opid,
Oid claid,
int2 opstrategy)
{
Relation idesc;
ScanKeyData skey[3];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(opid));
ScanKeyEntryInitialize(&skey[1],
(bits16) 0x0,
(AttrNumber) 2,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(claid));
ScanKeyEntryInitialize(&skey[2],
(bits16) 0x0,
(AttrNumber) 3,
(RegProcedure) F_INT2EQ,
Int16GetDatum(opstrategy));
idesc = index_openr(AccessMethodStrategyIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
index_close(idesc);
return tuple;
}
HeapTuple
AttributeNameIndexScan(Relation heapRelation,
Oid relid,
@@ -385,28 +317,6 @@ AttributeNumIndexScan(Relation heapRelation,
return tuple;
}
HeapTuple
IndexRelidIndexScan(Relation heapRelation, Oid relid)
{
Relation idesc;
ScanKeyData skey[1];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
(bits16) 0x0,
(AttrNumber) 1,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(relid));
idesc = index_openr(IndexRelidIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
index_close(idesc);
return tuple;
}
HeapTuple
ProcedureOidIndexScan(Relation heapRelation, Oid procId)

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.32 1999/07/20 16:48:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.33 1999/07/20 17:14:06 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
@@ -58,8 +58,8 @@ static struct cachedesc cacheinfo[] = {
0
},
sizeof(FormData_pg_amop),
AccessMethodOpidIndex,
(ScanFunc) AccessMethodOpidIndexScan},
NULL,
(ScanFunc) NULL},
{AccessMethodOperatorRelationName, /* AMOPSTRATEGY */
3,
{
@@ -69,8 +69,8 @@ static struct cachedesc cacheinfo[] = {
0
},
sizeof(FormData_pg_amop),
AccessMethodStrategyIndex,
(ScanFunc) AccessMethodStrategyIndexScan},
NULL,
(ScanFunc) NULL},
{AttributeRelationName, /* ATTNAME */
2,
{
@@ -81,7 +81,7 @@ static struct cachedesc cacheinfo[] = {
},
ATTRIBUTE_TUPLE_SIZE,
AttributeNameIndex,
(ScanFunc) IndexRelidIndexScan},
(ScanFunc) AttributeNameIndexScan},
{AttributeRelationName, /* ATTNUM */
2,
{
@@ -102,8 +102,8 @@ static struct cachedesc cacheinfo[] = {
0
},
offsetof(FormData_pg_index, indpred),
IndexRelidIndex,
(ScanFunc) IndexRelidIndexScan},
NULL,
NULL},
{LanguageRelationName, /* LANNAME */
1,
{
@@ -225,6 +225,17 @@ static struct cachedesc cacheinfo[] = {
sizeof(FormData_pg_opclass),
NULL,
NULL},
{IndexRelationName, /* INDRELIDKEY *//* never used */
2,
{
Anum_pg_index_indrelid,
Anum_pg_index_indkey,
0,
0
},
offsetof(FormData_pg_index, indpred),
NULL,
(ScanFunc) NULL},
{InheritsRelationName, /* INHRELID */
2,
{