Add some missing vacuum_delay_point calls in GIST vacuuming.

This commit is contained in:
Tom Lane 2006-02-14 16:39:32 +00:00
parent 006320e1d4
commit 49758f4703

View File

@ -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.14 2006/02/11 23:31:33 tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/gist/gistvacuum.c,v 1.15 2006/02/14 16:39:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -68,6 +68,8 @@ gistVacuumUpdate(GistVacuum *gv, BlockNumber blkno, bool needunion)
int ncompleted = 0,
lencompleted = 16;
vacuum_delay_point();
buffer = ReadBuffer(gv->index, blkno);
/*
@ -406,9 +408,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);
@ -561,7 +566,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 */
@ -649,7 +654,6 @@ gistbulkdelete(PG_FUNCTION_ARGS)
LockBuffer(buffer, GIST_UNLOCK);
ReleaseBuffer(buffer);
ptr = stack->next;
pfree(stack);
stack = ptr;