diff options
Diffstat (limited to 'src/backend/access/gist/gistvacuum.c')
-rw-r--r-- | src/backend/access/gist/gistvacuum.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/access/gist/gistvacuum.c b/src/backend/access/gist/gistvacuum.c index 11497c8093a..9d02ea7b46f 100644 --- a/src/backend/access/gist/gistvacuum.c +++ b/src/backend/access/gist/gistvacuum.c @@ -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.9 2005/09/22 20:44:36 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/gist/gistvacuum.c,v 1.9.2.1 2006/02/14 16:39:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -64,6 +64,8 @@ gistVacuumUpdate(GistVacuum *gv, BlockNumber blkno, bool needunion) int ncompleted = 0, lencompleted = 16; + vacuum_delay_point(); + buffer = ReadBuffer(gv->index, blkno); page = (Page) BufferGetPage(buffer); maxoff = PageGetMaxOffsetNumber(page); @@ -397,9 +399,12 @@ gistvacuumcleanup(PG_FUNCTION_ARGS) freePages = (BlockNumber *) palloc(sizeof(BlockNumber) * maxFreePages); for (blkno = GIST_ROOT_BLKNO + 1; blkno < npages; blkno++) { - Buffer buffer = ReadBuffer(rel, blkno); + Buffer buffer; Page page; + vacuum_delay_point(); + + buffer = ReadBuffer(rel, blkno); LockBuffer(buffer, GIST_SHARE); page = (Page) BufferGetPage(buffer); @@ -526,7 +531,7 @@ gistbulkdelete(PG_FUNCTION_ARGS) page = (Page) BufferGetPage(buffer); if (stack->blkno == GIST_ROOT_BLKNO && !GistPageIsLeaf(page)) { - /* the only root can become non-leaf during relock */ + /* only the root can become non-leaf during relock */ LockBuffer(buffer, GIST_UNLOCK); ReleaseBuffer(buffer); /* one more check */ @@ -614,7 +619,6 @@ gistbulkdelete(PG_FUNCTION_ARGS) LockBuffer(buffer, GIST_UNLOCK); ReleaseBuffer(buffer); - ptr = stack->next; pfree(stack); stack = ptr; |