8000 Reverse out cache changes that are not ready yet. · postgrespro/postgres_cluster@c175de5 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

< 8000 /div>
Appearance settings

Commit c175de5

Browse files
committed
Reverse out cache changes that are not ready yet.
1 parent 7944d50 commit c175de5

File tree

5 files changed

+84
-180
lines changed

5 files changed

+84
-180
lines changed

src/backend/catalog/index.c

Lines changed: 13 additions & 10 deletions
8000
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.86 1999/07/20 16:48:54 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.87 1999/07/20 17:14:05 momjian Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -52,23 +52,26 @@
5252

5353
/* non-export function prototypes */
5454
static Oid GetHeapRelationOid(char *heapRelationName, char *indexRelationName,
55-
bool istemp);
55+
bool istemp);
5656
static TupleDesc BuildFuncTupleDesc(FuncIndexInfo *funcInfo);
5757
static TupleDesc ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
58-
List *attributeList, int numatts, AttrNumber *attNums);
58+
List *attributeList,
59+
int numatts, AttrNumber *attNums);
5960

6061
static void ConstructIndexReldesc(Relation indexRelation, Oid amoid);
6162
static Oid UpdateRelationRelation(Relation indexRelation, char *temp_relname);
6263
static void InitializeAttributeOids(Relation indexRelation,
63-
int numatts, Oid indexoid);
64-
static void AppendAttributeTuples(Relation indexRelation, int numatts);
64+
int numatts,
65+
Oid indexoid);
66+
static void
67+
AppendAttributeTuples(Relation indexRelation, int numatts);
6568
static void UpdateIndexRelation(Oid indexoid, Oid heapoid,
66-
FuncIndexInfo *funcInfo, int natts,
67-
AttrNumber *attNums, Oid *classOids, Node *predicate,
68-
List *attributeList, bool islossy, bool unique, bool primary);
69+
FuncIndexInfo *funcInfo, int natts,
70+
AttrNumber *attNums, Oid *classOids, Node *predicate,
71+
List *attributeList, bool islossy, bool unique, bool primary);
6972
static void DefaultBuild(Relation heapRelation, Relation indexRelation,
70-
int numberOfAttributes, AttrNumber *attributeNumber,
71-
IndexStrategy indexStrategy, uint16 parameterCount,
73+
int numberOfAttributes, AttrNumber *attributeNumber,
74+
IndexStrategy indexStrategy, uint16 parameterCount,
7275
Datum *parameter, FuncIndexInfoPtr funcInfo, PredInfo *predInfo);
7376

7477
/* ----------------------------------------------------------------

src/backend/catalog/indexing.c

Lines changed: 19 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.41 1999/07/20 16:48:54 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.42 1999/07/20 17:14:06 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -28,29 +28,38 @@
2828

2929
/*
3030
* Names of indices on the following system catalogs:
31+
*
32+
* pg_attribute
33+
* pg_proc
34+
* pg_type
35+
* pg_naming
36+
* pg_class
37+
* pg_attrdef
38+
* pg_relcheck
39+
* pg_trigger
3140
*/
3241

33-
char *Name_pg_amop_indices[Num_pg_amop_indices] = {AccessMethodOpidIndex,
34-
AccessMethodStrategyIndex};
3542
char *Name_pg_attr_indices[Num_pg_attr_indices] = {AttributeNameIndex,
36-
AttributeNumIndex, AttributeRelidIndex};
37-
char *Name_pg_index_indices[Num_pg_index_indices] = {IndexRelidIndex};
43+
AttributeNumIndex,
44+
AttributeRelidIndex};
3845
char *Name_pg_proc_indices[Num_pg_proc_indices] = {ProcedureNameIndex,
39-
ProcedureOidIndex, ProcedureSrcIndex};
46+
ProcedureOidIndex,
47+
ProcedureSrcIndex};
4048
char *Name_pg_type_indices[Num_pg_type_indices] = {TypeNameIndex,
41-
TypeOidIndex};
49+
TypeOidIndex};
4250
char *Name_pg_class_indices[Num_pg_class_indices] = {ClassNameIndex,
43-
ClassOidIndex};
51+
ClassOidIndex};
4452
char *Name_pg_attrdef_indices[Num_pg_attrdef_indices] = {AttrDefaultIndex};
4553

4654
char *Name_pg_relcheck_indices[Num_pg_relcheck_indices] = {RelCheckIndex};
4755

4856
char *Name_pg_trigger_indices[Num_pg_trigger_indices] = {TriggerRelidIndex};
49-
char *Name_pg_description_indices[Num_pg_description_indices] = {DescriptionObjIndex};
5057

5158

5259
static HeapTuple CatalogIndexFetchTuple(Relation heapRelation,
53-
Relation idesc, ScanKey skey, int16 num_keys);
60+
Relation idesc,
61+
ScanKey skey,
62+
int16 num_keys);
5463

5564

5665
/*
@@ -243,89 +252,12 @@ CatalogIndexFetchTuple(Relation heapRelation,
243252
}
244253

245254

246-
/*---------------------------------------------------------------------
247-
* Class-specific index lookups
248-
*---------------------------------------------------------------------
249-
*/
250-
251255
/*
252256
* The remainder of the file is for individual index scan routines. Each
253257
* index should be scanned according to how it was defined during bootstrap
254258
* (that is, functional or normal) and what arguments the cache lookup
255259
* requires. Each routine returns the heap tuple that qualifies.
256260
*/
257-
HeapTuple
258-
AccessMethodOpidIndexScan(Relation heapRelation,
259-
Oid claid,
260-
Oid opopr,
261-
Oid opid)
262-
{
263-
Relation idesc;
264-
ScanKeyData skey[3];
265-
HeapTuple tuple;
266-
267-
ScanKeyEntryInitialize(&skey[0],
268-
(bits16) 0x0,
269-
(AttrNumber) 1,
270-
(RegProcedure) F_OIDEQ,
271-
ObjectIdGetDatum(claid));
272-
273-
ScanKeyEntryInitialize(&skey[1],
274-
(bits16) 0x0,
275-
(AttrNumber) 2,
276-
(RegProcedure) F_OIDEQ,
277-
ObjectIdGetDatum(opopr));
278-
279-
ScanKeyEntryInitialize(&skey[2],
280-
(bits16) 0x0,
281-
(AttrNumber) 3,
282-
(RegProcedure) F_OIDEQ,
283-
ObjectIdGetDatum(opid));
284-
285-
idesc = index_openr(AccessMethodOpidIndex);
286-
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
287-
288-
index_close(idesc);
289-
290-
return tuple;
291-
}
292-
293-
HeapTuple
294-
AccessMethodStrategyIndexScan(Relation heapRelation,
295-
Oid opid,
296-
Oid claid,
297-
int2 opstrategy)
298-
{
299-
Relation idesc;
300-
ScanKeyData skey[3];
301-
HeapTuple tuple;
302-
303-
ScanKeyEntryInitialize(&skey[0],
304-
(bits16) 0x0,
305-
(AttrNumber) 1,
306-
(RegProcedure) F_OIDEQ,
307-
ObjectIdGetDatum(opid));
308-
309-
ScanKeyEntryInitialize(&skey[1],
310-
(bits16) 0x0,
311-
(AttrNumber) 2,
312-
(RegProcedure) F_OIDEQ,
313-
ObjectIdGetDatum(claid));
314-
315-
ScanKeyEntryInitialize(&skey[2],
316-
(bits16) 0x0,
317-
(AttrNumber) 3,
318-
(RegProcedure) F_INT2EQ,
319-
Int16GetDatum(opstrategy));
320-
321-
idesc = index_openr(AccessMethodStrategyIndex);
322-
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 3);
323-
324-
index_close(idesc);
325-
326-
return tuple;
327-
}
328-
329261
HeapTuple
330262
AttributeNameIndexScan(Relation heapRelation,
331263
Oid relid,
@@ -385,28 +317,6 @@ AttributeNumIndexScan(Relation heapRelation,
385317
return tuple;
386318
}
387319

388-
HeapTuple
389-
IndexRelidIndexScan(Relation heapRelation, Oid relid)
390-
{
391-
Relation idesc;
392-
ScanKeyData skey[1];
393-
HeapTuple tuple;
394-
395-
ScanKeyEntryInitialize(&skey[0],
396-
(bits16) 0x0,
397-
(AttrNumber) 1,
398-
(RegProcedure) F_OIDEQ,
399-
ObjectIdGetDatum(relid));
400-
401-
idesc = index_openr(IndexRelidIndex);
402-
tuple = CatalogIndexFetchTuple(heapRelation, idesc, skey, 1);
403-
404-
index_close(idesc);
405-
406-
return tuple;
407-
}
408-
409-
410320

411321
HeapTuple
412322
ProcedureOidIndexScan(Relation heapRelation, Oid procId)

src/backend/utils/cache/syscache.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.32 1999/07/20 16:48:55 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.33 1999/07/20 17:14:06 momjian Exp $
1111
*
1212
* NOTES
1313
* These routines allow the parser/planner/executor to perform
@@ -58,8 +58,8 @@ static struct cachedesc cacheinfo[] = {
5858
0
5959
},
6060
sizeof(FormData_pg_amop),
61-
AccessMethodOpidIndex,
62-
(ScanFunc) AccessMethodOpidIndexScan},
61+
NULL,
62+
(ScanFunc) NULL},
6363
{AccessMethodOperatorRelationName, /* AMOPSTRATEGY */
6464
3,
6565
{
@@ -69,8 +69,8 @@ static struct cachedesc cacheinfo[] = {
6969
0
7070
},
7171
sizeof(FormData_pg_amop),
72-
AccessMethodStrategyIndex,
73-
(ScanFunc) AccessMethodStrategyIndexScan},
72+
NULL,
73+
(ScanFunc) NULL},
7474
{AttributeRelationName, /* ATTNAME */
7575
2,
7676
{
@@ -81,7 +81,7 @@ static struct cachedesc cacheinfo[] = {
8181
},
8282
ATTRIBUTE_TUPLE_SIZE,
8383
AttributeNameIndex,
84-
(ScanFunc) IndexRelidIndexScan},
84+
(ScanFunc) AttributeNameIndexScan},
8585
{AttributeRelationName, /* ATTNUM */
8686
2,
8787
{
@@ -102,8 +102,8 @@ static struct cachedesc cacheinfo[] = {
102102
0
103103
},
104104
offsetof(FormData_pg_index, indpred),
105-
IndexRelidIndex,
106-
(ScanFunc) IndexRelidIndexScan},
105+
NULL,
106+
NULL},
107107
{LanguageRelationName, /* LANNAME */
108108
1,
109109
{
@@ -225,6 +225,17 @@ static struct cachedesc cacheinfo[] = {
225225
sizeof(FormData_pg_opclass),
226226
NULL,
227227
NULL},
228+
{IndexRelationName, /* INDRELIDKEY *//* never used */
229+
2,
230+
{
231+
Anum_pg_index_indrelid,
232+
Anum_pg_index_indkey,
233+
0,
234+
0
235+
},
236+
offsetof(FormData_pg_index, indpred),
237+
NULL,
238+
(ScanFunc) NULL},
228239
{InheritsRelationName, /* INHRELID */
229240
2,
230241
{

0 commit comments

Comments
 (0)
0