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-07T16:14:48Z
Lists: pgsql-hackers
On Tue, Mar 7, 2017 at 11:09 AM, Dilip Kumar <dilipbalaut@gmail.com> wrote: > On Tue, Mar 7, 2017 at 9:34 PM, Robert Haas <robertmhaas@gmail.com> wrote: >> >> + if (DsaPointerIsValid(node->pstate->tbmiterator)) >> + tbm_free_shared_area(dsa, node->pstate->tbmiterator); >> + >> + if (DsaPointerIsValid(node->pstate->prefetch_iterator)) >> + dsa_free(dsa, node->pstate->prefetch_iterator); > > As per latest code, both should be calling to tbm_free_shared_area > because tbm_free_shared_area is capable of handling that. My silly > mistake. I will fix it. Thanks. I don't think I believe this rationale: + /* + * If one of the process has already identified that we need + * to do prefetch then let it perform the prefetch and allow + * others to proceed with the work in hand. Another option + * could be that we allow all of them to participate in + * prefetching. But, most of this work done under mutex or + * LWLock so ultimately we may end up in prefetching + * sequentially. + */ I mean, IIUC, the call to PrefetchBuffer() is not done under any lock. And that's the slow part. The tiny amount of time we spend updating the prefetch information under the mutex should be insignificant compared to the cost of actually reading the buffer. Unless I'm missing something. -- 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