mirror of
https://github.com/postgres/postgres.git
synced 2025-10-21 02:52:47 +03:00
Catcaches can now store negative entries as well as positive ones, to
speed up repetitive failed searches; per pghackers discussion in late January. inval.c logic substantially simplified, since we can now treat inserts and deletes alike as far as inval events are concerned. Some repair work needed in heap_create_with_catalog, which turns out to have been doing CommandCounterIncrement at a point where the new relation has non-self-consistent catalog entries. With the new inval code, that resulted in assert failures during a relcache entry rebuild.
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.215 2002/03/02 21:39:23 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.216 2002/03/03 17:47:54 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -527,7 +527,7 @@ vac_update_relstats(Oid relid, BlockNumber num_pages, double num_tuples,
|
||||
* no flush will occur, but no great harm is done since there are no
|
||||
* noncritical state updates here.)
|
||||
*/
|
||||
RelationInvalidateHeapTuple(rd, &rtup);
|
||||
CacheInvalidateHeapTuple(rd, &rtup);
|
||||
|
||||
/* Write the buffer */
|
||||
WriteBuffer(buffer);
|
||||
@@ -583,7 +583,7 @@ vac_update_dbstats(Oid dbid,
|
||||
dbform->datfrozenxid = frozenXID;
|
||||
|
||||
/* invalidate the tuple in the cache and write the buffer */
|
||||
RelationInvalidateHeapTuple(relation, tuple);
|
||||
CacheInvalidateHeapTuple(relation, tuple);
|
||||
WriteNoReleaseBuffer(scan->rs_cbuf);
|
||||
|
||||
heap_endscan(scan);
|
||||
@@ -1796,7 +1796,10 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
|
||||
*/
|
||||
heap_copytuple_with_tuple(&tuple, &newtup);
|
||||
|
||||
RelationInvalidateHeapTuple(onerel, &tuple);
|
||||
/*
|
||||
* register invalidation of source tuple in catcaches.
|
||||
*/
|
||||
CacheInvalidateHeapTuple(onerel, &tuple);
|
||||
|
||||
/* NO ELOG(ERROR) TILL CHANGES ARE LOGGED */
|
||||
START_CRIT_SECTION();
|
||||
@@ -1953,7 +1956,15 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
|
||||
/* copy tuple */
|
||||
heap_copytuple_with_tuple(&tuple, &newtup);
|
||||
|
||||
RelationInvalidateHeapTuple(onerel, &tuple);
|
||||
/*
|
||||
* register invalidation of source tuple in catcaches.
|
||||
*
|
||||
* (Note: we do not need to register the copied tuple,
|
||||
* because we are not changing the tuple contents and
|
||||
* so there cannot be any need to flush negative
|
||||
* catcache entries.)
|
||||
*/
|
||||
CacheInvalidateHeapTuple(onerel, &tuple);
|
||||
|
||||
/* NO ELOG(ERROR) TILL CHANGES ARE LOGGED */
|
||||
START_CRIT_SECTION();
|
||||
|
Reference in New Issue
Block a user