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

Remove Ops parameter from STATRELID cache lookup, for Tom Lane and

optimizer.
This commit is contained in:
Bruce Momjian
2000-01-24 02:12:58 +00:00
parent 4d564c5b12
commit da5aba105f
8 changed files with 61 additions and 73 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.56 2000/01/10 16:13:12 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.57 2000/01/24 02:12:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -64,7 +64,7 @@ char *Name_pg_rewrite_indices[Num_pg_rewrite_indices] =
char *Name_pg_shadow_indices[Num_pg_shadow_indices] =
{ShadowNameIndex, ShadowSysidIndex};
char *Name_pg_statistic_indices[Num_pg_statistic_indices] =
{StatisticRelidAttnumOpIndex};
{StatisticRelidAttnumIndex};
char *Name_pg_trigger_indices[Num_pg_trigger_indices] =
{TriggerRelidIndex, TriggerConstrNameIndex, TriggerConstrRelidIndex};
char *Name_pg_type_indices[Num_pg_type_indices] =
@@ -926,13 +926,12 @@ ShadowSysidIndexScan(Relation heapRelation, int4 sysId)
HeapTuple
StatisticRelidAttnumOpIndexScan(Relation heapRelation,
StatisticRelidAttnumIndexScan(Relation heapRelation,
Oid relId,
AttrNumber attNum,
Oid op)
AttrNumber attNum)
{
Relation idesc;
ScanKeyData skey[3];
ScanKeyData skey[2];
HeapTuple tuple;
ScanKeyEntryInitialize(&skey[0],
@@ -947,14 +946,8 @@ StatisticRelidAttnumOpIndexScan(Relation heapRelation,
(RegProcedure) F_INT2EQ,
Int16GetDatum(attNum));
ScanKeyEntryInitialize(&skey[2],
(bits16) 0x0,
(AttrNumber) 3,
(RegProcedure) F_OIDEQ,
ObjectIdGetDatum(op));
idesc = index_openr(StatisticRelidAttnumOpIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
idesc = index_openr(StatisticRelidAttnumIndex);
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 2);
index_close(idesc);

View File

@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.51 2000/01/23 03:43:23 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.52 2000/01/24 02:12:55 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -609,7 +609,7 @@ getattstatistics(Oid relid, AttrNumber attnum, Oid opid, Oid typid,
tuple = SearchSysCacheTuple(STATRELID,
ObjectIdGetDatum(relid),
Int16GetDatum((int16) attnum),
opid,
0,
0);
if (!HeapTupleIsValid(tuple))
{

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.45 2000/01/23 03:43:24 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.46 2000/01/24 02:12:56 momjian Exp $
*
* NOTES
* These routines allow the parser/planner/executor to perform
@@ -54,7 +54,7 @@ typedef HeapTuple (*ScanFunc) ();
Add your new cache to the list in include/utils/syscache.h. Keep
the list sorted alphabetically and adjust the cache numbers
accordingly.
Add your entry to the cacheinfo[] array below. All cache lists are
alphabetical, so add it in the proper place. Specify the relation
name, number of arguments, argument names, size of tuple, index lookup
@@ -75,7 +75,7 @@ typedef HeapTuple (*ScanFunc) ();
Finally, any place your relation gets heap_insert() or
heap_update calls, include code to do a CatalogIndexInsert() to update
the system indexes. The heap_* calls do not update indexes.
bjm 1999/11/22
---------------------------------------------------------------------------
@@ -360,16 +360,16 @@ NULL,NULL
/* ShadowSysidIndex,
ShadowSysidIndexScan*/},
{StatisticRelationName, /* STATRELID */
3,
2,
{
Anum_pg_statistic_starelid,
Anum_pg_statistic_staattnum,
Anum_pg_statistic_staop,
0,
0
},
offsetof(FormData_pg_statistic, stacommonval),
StatisticRelidAttnumOpIndex,
(ScanFunc) StatisticRelidAttnumOpIndexScan},
StatisticRelidAttnumIndex,
(ScanFunc) StatisticRelidAttnumIndexScan},
{TypeRelationName, /* TYPENAME */
1,
{
@@ -520,7 +520,7 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
get_temp_rel_by_username(DatumGetPointer(key1))) != NULL)
key1 = PointerGetDatum(nontemp_relname);
}
tp = SearchSysCache(SysCache[cacheId], key1, key2, key3, key4);
if (!HeapTupleIsValid(tp))
{