Re: Parallel bitmap heap scan
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>, Haribabu Kommi <kommi.haribabu@gmail.com>,
Rafia Sabih <rafia.sabih@enterprisedb.com>, tushar <tushar.ahuja@enterprisedb.com>,
Amit Khandekar <amitdkhan.pg@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, Andres Freund <andres@anarazel.de>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-03-08T13:12:02Z
Lists: pgsql-hackers
On Wed, Mar 8, 2017 at 1:49 AM, Dilip Kumar <dilipbalaut@gmail.com> wrote: > On Tue, Mar 7, 2017 at 10:10 PM, Dilip Kumar <dilipbalaut@gmail.com> wrote: >>> It's not about speed. It's about not forgetting to prefetch. Suppose >>> that worker 1 becomes the prefetch worker but then doesn't return to >>> the Bitmap Heap Scan node for a long time because it's busy in some >>> other part of the plan tree. Now you just stop prefetching; that's >>> bad. You want prefetching to continue regardless of which workers are >>> busy doing what; as long as SOME worker is executing the parallel >>> bitmap heap scan, prefetching should continue as needed. >> >> Right, I missed this part. I will fix this. > I have fixed this part, after doing that I realised if multiple > processes are prefetching then it may be possible that in boundary > cases (e.g. suppose prefetch_target is 3 and prefetch_pages is at 2) > there may be some extra prefetch but finally those prefetched blocks > will be used. Another, solution to this problem is that we can > increase the prefetch_pages in advance then call tbm_shared_iterate, > this will avoid extra prefetch. But I am not sure what will be best > here. I don't think I understand exactly why this system might be prone to a little bit of extra prefetching - can you explain further? I don't think it will hurt anything as long as we are talking about a small number of extra prefetches here and there. > Fixed Committed 0001. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Pass DSA_ALLOC_HUGE when allocating a shared TIDBitmap.
- a171f01501e1 10.0 landed
-
Support parallel bitmap heap scans.
- f35742ccb7aa 10.0 landed
-
tidbitmap: Support shared iteration.
- 98e6e89040a0 10.0 landed
-
Shut down Gather's children before shutting down Gather itself.
- acf555bc53ac 10.0 landed
-
Revise the way the element allocator for a simplehash is specified.
- c3c4f6e1740b 10.0 cited
-
Refactor bitmap heap scan estimation of heap pages fetched.
- da08a6598973 10.0 landed
-
Use more efficient hashtable for tidbitmap.c to speed up bitmap scans.
- 75ae538bc316 10.0 cited