Re: Memory Alignment in Postgres

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Memory Alignment in Postgres
Дата
Msg-id 20140911154635.GC11983@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: Memory Alignment in Postgres  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2014-09-11 11:39:12 -0400, Tom Lane wrote:
> Even on Intel, I'd wonder what unaligned accesses do to atomicity
> guarantees and suchlike.

They pretty much kill atomicity guarantees. Atomicity is guaranteed
while you're inside a cacheline, but not once you span them.

> This is not a big deal for row data storage,
> but we'd have to be careful about it if we were to back off alignment
> requirements for in-memory data structures such as latches and buffer
> headers.

Right. I don't think that's an option.

> Another fun thing you'd need to deal with is ensuring that the C structs
> we overlay onto catalog data rows still match up with the data layout
> rules.

Yea, this would require some nastyness in the bki generation, but it'd
probably doable to have different alignment for system catalogs.

> On the whole, I'm pretty darn skeptical that such an effort would repay
> itself.  There are lots of more promising things to hack on.

I have no desire to hack on it, but I can understand the desire to
reduce the space overhead...

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal (9.5) : psql unicode border line styles
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: proposal: ignore null fields in not relation type composite type based constructors