On Thu, Nov 19, 2020 at 5:39 PM Alexey Kondratov
<a.kondra...@postgrespro.ru> wrote:
>
> >
> > By clearing the cache entry we will have 2 advantages: 1) we could
> > save a(small) bit of memory 2) we could allow new connections to be
> > cached, currently ConnectionHash can have only 8 entries. IMHO, along
> > with disconnecting, we can also clear off the cache entry. Thoughts?
> >
>
> IIUC, 8 is not a hard limit, it is just a starting size. ConnectionHash
> is not a shared-memory hash table, so dynahash can expand it on-the-fly
> as follow, for example, from the comment before hash_create():
>

Thanks! Yes this is true. I was wrong earlier. I verified that 8 is
not a hard limit.

>
> Also I am not sure that by doing just a HASH_REMOVE you will free any
> memory, since hash table is already allocated (or expanded) to some
> size. So HASH_REMOVE will only add removed entry to the freeList, I
> guess.
>
> Anyway, I can hardly imagine bloating of ConnectionHash to be a problem
> even in the case, when one has thousands of foreign servers all being
> accessed during a single backend life span.
>

Okay. I will not add the code to remove the entries from cache.

Here is how I'm making 4 separate patches:

1. new function and it's documentation.
2. GUC and it's documentation.
3. server level option and it's documentation.
4. test cases for all of the above patches.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com


Reply via email to