Re: Parallel Bitmap Heap Scan reports per-worker stats in EXPLAIN ANALYZE - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Parallel Bitmap Heap Scan reports per-worker stats in EXPLAIN ANALYZE
Date
Msg-id CAAKRu_a_c8HAtJ8Ynz-dU=Jb2PzheW0zWME6A1BB9jQ62DMZBg@mail.gmail.com
Whole thread
In response to Re: Parallel Bitmap Heap Scan reports per-worker stats in EXPLAIN ANALYZE  (Tomas Vondra <tomas@vondra.me>)
Responses Re: Parallel Bitmap Heap Scan reports per-worker stats in EXPLAIN ANALYZE
Re: Parallel Bitmap Heap Scan reports per-worker stats in EXPLAIN ANALYZE
List pgsql-hackers
On Fri, Apr 3, 2026 at 3:20 PM Tomas Vondra <tomas@vondra.me> wrote:
>
> I'm working on adding information about prefetching for scans [1], which
> includes BitmapHeapScan. I realized the instrumentation added by this
> thread may not be quite right, resulting in missing instrumentation for
> non-parallel-aware scans in a parallel query.
>
> A better description / explanation of the issue is posted here [2]. I've
> posted a proposed fix in the following message [3], in a patch:
>
>   v8-0002-Show-Bitmap-Heap-Scan-stats-for-non-parallel-awar.patch
>
> I wonder if someone from this thread could review my analysis, and
> confirm this is not intentional. I don't see it discussed in the thread,
> so I assume no one noticed this behavior. I'd also appreciate a review
> of the proposed fix, or suggestions for alternative fixes.

I can't imagine this was intentional.

I reviewed your approach and suggest we aim for even lower impact by
always allocating the ParallelBitmapHeapState. That means the DSM
layout won't differ such that pcxt->toc has to point to the
instrumentation in the parallel-oblivious case and the pstate in the
parallel-aware case. Attached is a patch that does this.

- Melanie

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Duplicate RequestNamedLWLocktranche() names and test_lwlock_tranches improvements
Next
From: Heikki Linnakangas
Date:
Subject: Re: Better shared data structure management and resizable shared data structures