Re: [PROPOSAL] Shared Ispell dictionaries - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [PROPOSAL] Shared Ispell dictionaries
Date
Msg-id CA+TgmobejQCE7GEX5Nx6ZDwT1ifdjtK+q5dWZV9QXXe_CjQkHw@mail.gmail.com
Whole thread Raw
In response to Re: [PROPOSAL] Shared Ispell dictionaries  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: [PROPOSAL] Shared Ispell dictionaries
List pgsql-hackers
On Tue, Jan 22, 2019 at 2:17 PM Tomas Vondra
<tomas.vondra@2ndquadrant.com> wrote:
> I think there are essentially two ways:
>
> (a) Define max amount of memory available for shared dictionarires, and
> come up with an eviction algorithm. This will be tricky, because when
> the frequently-used dictionaries need a bit more memory than the limit,
> this will result in trashing (evict+load over and over).
>
> (b) Define what "unused" means for dictionaries, and unload dictionaries
> that become unused. For example, we could track timestamp of the last
> time each dict was used, and decide that dictionaries unused for 5 or
> more minutes are unused. And evict those.
>
> The advantage of (b) is that it adopts automatically, more or less. When
> you have a bunch of frequently used dictionaries, the amount of shared
> memory increases. If you stop using them, it decreases after a while.
> And rarely used dicts won't force eviction of the frequently used ones.

+1 for (b).

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Synchronous replay take III
Next
From: Michael Goldshteyn
Date:
Subject: Is zheap on track for PostgreSQL 12.0?