aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gin/ginfast.c
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2015-09-07 17:16:29 +0300
committerTeodor Sigaev <teodor@sigaev.ru>2015-09-07 17:16:29 +0300
commite26692248ada18417199b47bc2e4e1648d530953 (patch)
tree76652d413030cbbf22068ea519fb383beba801aa /src/backend/access/gin/ginfast.c
parente95680832854cf300e64c10de9cc2f586df558e8 (diff)
downloadpostgresql-e26692248ada18417199b47bc2e4e1648d530953.tar.gz
postgresql-e26692248ada18417199b47bc2e4e1648d530953.zip
Make GIN's cleanup pending list process interruptable
Cleanup process could be called by ordinary insert/update and could take a lot of time. Add vacuum_delay_point() to make this process interruptable. Under vacuum this call will also throttle a vacuum process to decrease system load, called from insert/update it will not throttle, and that reduces a latency. Backpatch for all supported branches. Jeff Janes <jeff.janes@gmail.com>
Diffstat (limited to 'src/backend/access/gin/ginfast.c')
-rw-r--r--src/backend/access/gin/ginfast.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c
index fa8d8a756eb..76bebad8e1f 100644
--- a/src/backend/access/gin/ginfast.c
+++ b/src/backend/access/gin/ginfast.c
@@ -810,8 +810,7 @@ ginInsertCleanup(GinState *ginstate,
*/
processPendingPage(&accum, &datums, page, FirstOffsetNumber);
- if (vac_delay)
- vacuum_delay_point();
+ vacuum_delay_point();
/*
* Is it time to flush memory to disk? Flush if we are at the end of
@@ -851,8 +850,7 @@ ginInsertCleanup(GinState *ginstate,
{
ginEntryInsert(ginstate, attnum, key, category,
list, nlist, NULL);
- if (vac_delay)
- vacuum_delay_point();
+ vacuum_delay_point();
}
/*
@@ -937,7 +935,7 @@ ginInsertCleanup(GinState *ginstate,
/*
* Read next page in pending list
*/
- CHECK_FOR_INTERRUPTS();
+ vacuum_delay_point();
buffer = ReadBuffer(index, blkno);
LockBuffer(buffer, GIN_SHARE);
page = BufferGetPage(buffer);