Parallel Bitmap Heap Scan - Prefetch pages are not updated properly
While analyzing the coverage for the prefetching part, I found an
issue that prefetch_pages were not updated properly while executing in
parallel mode.
Attached patch fixes the same.
--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com
Attachments:
parallel_bitmap_prefetch_fix.patchapplication/octet-stream; name=parallel_bitmap_prefetch_fix.patchDownload
diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c
index 19eb175..d240f9c 100644
--- a/src/backend/executor/nodeBitmapHeapscan.c
+++ b/src/backend/executor/nodeBitmapHeapscan.c
@@ -494,7 +494,7 @@ BitmapAdjustPrefetchIterator(BitmapHeapScanState *node,
SpinLockAcquire(&pstate->mutex);
if (pstate->prefetch_pages > 0)
{
- node->prefetch_pages--;
+ pstate->prefetch_pages--;
SpinLockRelease(&pstate->mutex);
}
else
On Tue, Apr 4, 2017 at 6:24 AM, Dilip Kumar <dilipbalaut@gmail.com> wrote:
While analyzing the coverage for the prefetching part, I found an
issue that prefetch_pages were not updated properly while executing in
parallel mode.Attached patch fixes the same.
Wow, OK. Committed.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers