Re: WALInsertLock tuning

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: WALInsertLock tuning
Дата
Msg-id 4DEE457D.5050309@enterprisedb.com
обсуждение исходный текст
Ответ на Re: WALInsertLock tuning  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: WALInsertLock tuning  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 07.06.2011 10:55, Simon Riggs wrote:
> On Tue, Jun 7, 2011 at 8:27 AM, Heikki Linnakangas
> <heikki.linnakangas@enterprisedb.com>  wrote:
>> You would only need to do it just before you write out the WAL. I guess
>> you'd need to grab WALInsertLock in XLogWrite() to prevent more WAL records
>> from being inserted on the page until you're done zeroing it, though.
>
> How would that help?

It doesn't matter whether the pages are zeroed while they sit in memory. 
And if you write a full page of WAL data, any wasted bytes at the end of 
the page don't matter, because they're ignored at replay anyway. The 
possibility of mistaking random garbage for valid WAL only occurs when 
we write a partial WAL page to disk. So, it is enough to zero the 
remainder of the partial WAL page (or just the next few words) when we 
write it out.

That's a lot cheaper than fully zeroing every page. (except for the fact 
that you'd need to hold WALInsertLock while you do it)

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: SIREAD lock versus ACCESS EXCLUSIVE lock
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: reducing the overhead of frequent table locks - now, with WIP patch