On Mon, Apr 6, 2026 at 5:15 AM Tomas Vondra <tomas@vondra.me> wrote:
>
> Anyway, that doesn't matter much, because the more I look at the
> approach with having a separate chunk of shared memory, the more I like
> it. It seems much simpler, more elegant, etc. I really disliked how
> unreadable the code got with the parallel_aware/instrument checks in
> multiple places, and this just gets rid of that. I like that.
>
<--snip-->
>
> Is execParallel.h the right place to define the offset? It means the
> various nodes (like nodeBitmapHeapScan) now have to include this header,
> and it seems a bit suspicious. I can't think of a better .h file, and
> maybe I'm wrong and it's perfectly fine.
It could go in src/include/executor is instrument_node.h. It's where
the structs for the shared instrumentation go. It's probably cheaper
to include also because it doesn't include anything.
> Regarding plan_node_id - I think the offset works fine for now. It
> effectively gives us 2 IDs per node. The only alternative I can think of
> is having nodes "request" how many IDs will be needed - most nodes would
> say "1", nodes with instrumentation would say "2", etc. In the future we
> might get a node that needs 3+ shm chunks. I don't think we need to do
> all that now.
Makes sense to me.
- Melanie