Commit 49758f47 authored by Tom Lane's avatar Tom Lane

Add some missing vacuum_delay_point calls in GIST vacuuming.

parent 006320e1
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * 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) ...@@ -68,6 +68,8 @@ gistVacuumUpdate(GistVacuum *gv, BlockNumber blkno, bool needunion)
int ncompleted = 0, int ncompleted = 0,
lencompleted = 16; lencompleted = 16;
vacuum_delay_point();
buffer = ReadBuffer(gv->index, blkno); buffer = ReadBuffer(gv->index, blkno);
/* /*
...@@ -406,9 +408,12 @@ gistvacuumcleanup(PG_FUNCTION_ARGS) ...@@ -406,9 +408,12 @@ gistvacuumcleanup(PG_FUNCTION_ARGS)
freePages = (BlockNumber *) palloc(sizeof(BlockNumber) * maxFreePages); freePages = (BlockNumber *) palloc(sizeof(BlockNumber) * maxFreePages);
for (blkno = GIST_ROOT_BLKNO + 1; blkno < npages; blkno++) for (blkno = GIST_ROOT_BLKNO + 1; blkno < npages; blkno++)
{ {
Buffer buffer = ReadBuffer(rel, blkno); Buffer buffer;
Page page; Page page;
vacuum_delay_point();
buffer = ReadBuffer(rel, blkno);
LockBuffer(buffer, GIST_SHARE); LockBuffer(buffer, GIST_SHARE);
page = (Page) BufferGetPage(buffer); page = (Page) BufferGetPage(buffer);
...@@ -561,7 +566,7 @@ gistbulkdelete(PG_FUNCTION_ARGS) ...@@ -561,7 +566,7 @@ gistbulkdelete(PG_FUNCTION_ARGS)
page = (Page) BufferGetPage(buffer); page = (Page) BufferGetPage(buffer);
if (stack->blkno == GIST_ROOT_BLKNO && !GistPageIsLeaf(page)) 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); LockBuffer(buffer, GIST_UNLOCK);
ReleaseBuffer(buffer); ReleaseBuffer(buffer);
/* one more check */ /* one more check */
...@@ -649,7 +654,6 @@ gistbulkdelete(PG_FUNCTION_ARGS) ...@@ -649,7 +654,6 @@ gistbulkdelete(PG_FUNCTION_ARGS)
LockBuffer(buffer, GIST_UNLOCK); LockBuffer(buffer, GIST_UNLOCK);
ReleaseBuffer(buffer); ReleaseBuffer(buffer);
ptr = stack->next; ptr = stack->next;
pfree(stack); pfree(stack);
stack = ptr; stack = ptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment