On Wed, Feb 20, 2019 at 9:33 AM Arthur Zakirov <a.zaki...@postgrespro.ru> wrote: > I'm working on the (b) approach. I thought about a priority queue > structure. There no such ready structure within PostgreSQL sources > except binaryheap.c, but it isn't for concurrent algorithms.
I don't see why you need a priority queue or, really, any other fancy data structure. It seems like all you need to do is somehow set it up so that a backend which doesn't use a dictionary for a while will dsm_detach() the segment. Eventually an unused dictionary will have no remaining references and will go away. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company