Re: pg_sequence catalog

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: pg_sequence catalog
Дата
Msg-id 20160831170845.u4qah25ymbwyora4@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: pg_sequence catalog  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pg_sequence catalog  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi,

On 2016-08-31 12:53:30 -0400, Tom Lane wrote:
> Improving on the space wastage is exactly the point IMO.  If it's still
> going to be 8k per sequence on disk (*and* in shared buffers, remember),
> I'm not sure it's worth all the work to change things at all.

A separate file is a heck lot more heavyweight than another 8 kb in an
existing file.


> Another idea would be to have nominally per-sequence LWLocks (or
> spinlocks?) controlling nextval's nontransactional accesses to the catalog
> rows, but to map those down to some fixed number of locks in a way similar
> to the current fallback implementation for spinlocks, which maps them onto
> a fixed number of semaphores.  You'd trade off shared memory against
> contention while choosing the underlying number of locks.

If we could rely on spinlocks to actually be spinlocks, we could just
put the spinlock besides the actual state data... Not entirely pretty,
but probably pretty simple.


- Andres



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

Предыдущее
От: Claudio Freire
Дата:
Сообщение: Re: Patch: Write Amplification Reduction Method (WARM)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pg_sequence catalog