Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commit26ac217

Browse files
committed
Catcaches can now store negative entries as well as positive ones, to
speed up repetitive failed searches; per pghackers discussion in lateJanuary. inval.c logic substantially simplified, since we can now treatinserts and deletes alike as far as inval events are concerned. Somerepair work needed in heap_create_with_catalog, which turns out to havebeen doing CommandCounterIncrement at a point where the new relation hasnon-self-consistent catalog entries. With the new inval code, thatresulted in assert failures during a relcache entry rebuild.
1 parent592caa0 commit26ac217

File tree

10 files changed

+829
-594
lines changed

10 files changed

+829
-594
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.130 2002/03/02 21:39:17 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.131 2002/03/03 17:47:53 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -1131,12 +1131,12 @@ heap_insert(Relation relation, HeapTuple tup)
11311131
WriteBuffer(buffer);
11321132

11331133
/*
1134-
* If tuple is cachable, mark it forrollback from the caches in case
1134+
* If tuple is cachable, mark it forinvalidation from the caches in case
11351135
* we abort. Note it is OK to do this after WriteBuffer releases the
11361136
* buffer, because the "tup" data structure is all in local memory,
11371137
* not in the shared buffer.
11381138
*/
1139-
RelationMark4RollbackHeapTuple(relation,tup);
1139+
CacheInvalidateHeapTuple(relation,tup);
11401140

11411141
returntup->t_data->t_oid;
11421142
}
@@ -1278,7 +1278,7 @@ heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid)
12781278
* look at the contents of the tuple, so we need to hold our refcount
12791279
* on the buffer.
12801280
*/
1281-
RelationInvalidateHeapTuple(relation,&tp);
1281+
CacheInvalidateHeapTuple(relation,&tp);
12821282

12831283
WriteBuffer(buffer);
12841284

@@ -1585,19 +1585,19 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
15851585
* boundary. We have to do this before WriteBuffer because we need to
15861586
* look at the contents of the tuple, so we need to hold our refcount.
15871587
*/
1588-
RelationInvalidateHeapTuple(relation,&oldtup);
1588+
CacheInvalidateHeapTuple(relation,&oldtup);
15891589

15901590
if (newbuf!=buffer)
15911591
WriteBuffer(newbuf);
15921592
WriteBuffer(buffer);
15931593

15941594
/*
1595-
* If new tuple is cachable, mark it forrollback from the caches in
1595+
* If new tuple is cachable, mark it forinvalidation from the caches in
15961596
* case we abort. Note it is OK to do this after WriteBuffer releases
15971597
* the buffer, because the "newtup" data structure is all in local
15981598
* memory, not in the shared buffer.
15991599
*/
1600-
RelationMark4RollbackHeapTuple(relation,newtup);
1600+
CacheInvalidateHeapTuple(relation,newtup);
16011601

16021602
returnHeapTupleMayBeUpdated;
16031603
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp