Dear Alvaro,
Thanks for discussing!
>
> I think it would be worth allocating AutoVacuumShmem->av_workItems using
> dynamic shmem allocation, particularly to prevent workitems from being
> discarded just because the array is full¹; but other than that, the
> struct is just 64 bytes long so I doubt it's useful to allocate it
> dynamically.
>
> ¹ I mean, if the array is full, just allocate another array, point to it
> from the original one, and keep going.
OK, I understood that my initial proposal is not so valuable, so I can withdraw it.
About the suggetion, you imagined AutoVacuumRequestWork() and brininsert(),
right? I agreed it sounds good, but I don't think it can be implemented by current
interface. An interface for dynamically allocating memory is GetNamedDSMSegment(),
and it returns the same shared memory region if input names are the same.
Therefore, there is no way to re-alloc the shared memory.
Best Regards,
Hayato Kuroda
FUJITSU LIMITED
https://www.fujitsu.com/