mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Allow VACUUM to complete faster by avoiding scanning the indexes when no
rows were removed from the heap by the VACUUM. Simon Riggs
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/gist/gistvacuum.c,v 1.11 2005/11/22 18:17:05 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/gist/gistvacuum.c,v 1.12 2006/02/11 16:59:08 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -125,7 +125,7 @@ gistVacuumUpdate(GistVacuum *gv, BlockNumber blkno, bool needunion)
|
||||
if (chldtuple.ituplen > 1)
|
||||
{
|
||||
/*
|
||||
* child was splitted, so we need mark completion
|
||||
* child was split, so we need mark completion
|
||||
* insert(split)
|
||||
*/
|
||||
int j;
|
||||
@ -329,9 +329,9 @@ gistVacuumUpdate(GistVacuum *gv, BlockNumber blkno, bool needunion)
|
||||
}
|
||||
|
||||
/*
|
||||
* For usial vacuum just update FSM, for full vacuum
|
||||
* For usual vacuum just update FSM, for full vacuum
|
||||
* reforms parent tuples if some of childs was deleted or changed,
|
||||
* update invalid tuples (they can exsist from last crash recovery only),
|
||||
* update invalid tuples (they can exist from last crash recovery only),
|
||||
* tries to get smaller index
|
||||
*/
|
||||
|
||||
@ -505,10 +505,15 @@ gistbulkdelete(PG_FUNCTION_ARGS)
|
||||
*ptr;
|
||||
bool needLock;
|
||||
|
||||
stack = (GistBDItem *) palloc0(sizeof(GistBDItem));
|
||||
if (callback_state)
|
||||
{
|
||||
stack = (GistBDItem *) palloc0(sizeof(GistBDItem));
|
||||
|
||||
stack->blkno = GIST_ROOT_BLKNO;
|
||||
needFullVacuum = false;
|
||||
stack->blkno = GIST_ROOT_BLKNO;
|
||||
needFullVacuum = false;
|
||||
}
|
||||
else
|
||||
stack = NULL;
|
||||
|
||||
while (stack)
|
||||
{
|
||||
|
Reference in New Issue
Block a user