diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2015-09-07 17:17:15 +0300 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2015-09-07 17:17:15 +0300 |
commit | d592a8745fd0320fd5e691b59bf5a95d9834a286 (patch) | |
tree | 7131317d12ba495e61c85f9cf2bb0aeec0145b3f | |
parent | 552723a3bf6d3caefafaa0afe9afcde31ccdb481 (diff) | |
download | postgresql-d592a8745fd0320fd5e691b59bf5a95d9834a286.tar.gz postgresql-d592a8745fd0320fd5e691b59bf5a95d9834a286.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>
-rw-r--r-- | src/backend/access/gin/ginfast.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/backend/access/gin/ginfast.c b/src/backend/access/gin/ginfast.c index 7b4f85df881..65471eb9f23 100644 --- a/src/backend/access/gin/ginfast.c +++ b/src/backend/access/gin/ginfast.c @@ -801,8 +801,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 @@ -842,8 +841,7 @@ ginInsertCleanup(GinState *ginstate, { ginEntryInsert(ginstate, attnum, key, category, list, nlist, NULL); - if (vac_delay) - vacuum_delay_point(); + vacuum_delay_point(); } /* @@ -923,7 +921,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); |