Re: Protect syscache from bloating with negative cache entries

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Protect syscache from bloating with negative cache entries
Дата
Msg-id 8900.1551970350@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Protect syscache from bloating with negative cache entries  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Mar 6, 2019 at 6:18 PM Tomas Vondra
> <tomas.vondra@2ndquadrant.com> wrote:
>> Which part of the LRU approach is supposedly expensive? Updating the
>> lastaccess field or moving the entries to tail? I'd guess it's the
>> latter, so perhaps we can keep some sort of age field, update it less
>> frequently (once per minute?), and do the clock sweep?

> Move to tail (although lastaccess would be expensive if too if it
> involves an extra gettimeofday() call).

As I recall, the big problem with the old LRU code was loss of
locality of access, in that in addition to the data associated with
hot syscache entries, you were necessarily also touching list link
fields associated with not-hot entries.  That's bad for the CPU cache.

A gettimeofday call (or any other kernel call) per syscache access
would be a complete disaster.

            regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: amul sul
Дата:
Сообщение: Re: [HACKERS] advanced partition matching algorithm forpartition-wise join
Следующее
От: Alexander Kuzmenkov
Дата:
Сообщение: Re: Optimze usage of immutable functions as relation