Re: sequence cache is kept forever

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: sequence cache is kept forever
Дата
Msg-id 3087536.1637344248@sss.pgh.pa.us
обсуждение исходный текст
Ответ на sequence cache is kept forever  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Ответы Re: sequence cache is kept forever  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Список pgsql-hackers
Tomas Vondra <tomas.vondra@enterprisedb.com> writes:
> While working on a patch, I noticed that we never clean the cache of 
> sequence values, i.e. seqhashtab in sequence.c. That is, once we create 
> an entry for a sequence (by calling nextval), it will stay forever 
> (until the backend terminates). Even if the sequence gets dropped, the 
> entry stays behind.

It might be reasonable to drop entries when their sequence is dropped,
though I wonder how much that would move the needle for real-world
usages.  Dropping an entry "just because" risks losing cached value
assignments, which might be unpleasant (e.g. due to faster advancement
of the sequence's counter, more WAL traffic, etc).  With no actual
complaints from the field, I'm disinclined to do that.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: update with no changes
Следующее
От: Marcos Pegoraro
Дата:
Сообщение: Re: update with no changes