Re: unlogged tables vs. GIST

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: unlogged tables vs. GIST
Дата
Msg-id AANLkTikuCukaVdQK2xLH0ViuFF3qzCOb4=V3JjQAZDdQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: unlogged tables vs. GIST  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: unlogged tables vs. GIST  (Jeevan Chalke <jeevan.chalke@enterprisedb.com>)
Список pgsql-hackers
On Fri, Dec 17, 2010 at 4:17 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Since these bits will only be set/cleared when the buffer mapping is
>> changed, can we examine this bit without taking the spinlock?
>
> Only if you're willing for the result to be unreliable.

If we read the bits while someone else is writing them, we'll get
either the old or the new value, but the BM_FLUSH_XLOG bit will be the
same either way.  When FlushBuffer() is called, a shared content log
and a pin are held, so the buffer can't be renamed under us.  If
that's really unacceptable, we can do something like the attached, but
I think this is unnecessarily gross.  We already assume in other
places that the read or write of an integer is atomic.  In this case
we don't even need it to be fully atomic - we just need the particular
byte that contains this bit not to go through some intermediate state
where the bit is unset.  Is there really a memory architecture out
there that's crazy enough to let such a thing happen?  If so, I'd
expect things to be breaking right and left on that machine anyway.

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

Вложения

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

Предыдущее
От: andreas
Дата:
Сообщение: Tab completion for ALTER ... SET SCHEMA
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Tab completion for ALTER ... SET SCHEMA