Reducing ClogControlLock contention

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Reducing ClogControlLock contention
Дата
Msg-id CANP8+j+imQfHxkChFyfnXDyi6k-arAzRV+ZG-V_OFxEtJjOL2Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Reducing ClogControlLock contention
Re: Reducing ClogControlLock contention
Re: Reducing ClogControlLock contention
Список pgsql-hackers
ClogControlLock contention is high at commit time. This appears to be due to the fact that ClogControlLock is acquired in Exclusive mode prior to marking commit, which then gets starved by backends running TransactionIdGetStatus().

Proposal for improving this is to acquire the ClogControlLock in Shared mode, if possible.

This is safe because people checking visibility of an xid must always run TransactionIdIsInProgress() first to avoid race conditions, which will always return true for the transaction we are currently committing. As a result, we never get concurrent access to the same bits in clog, which would require a barrier.

Two concurrent writers might access the same word concurrently, so we protect against that with a new CommitLock. We could partition that by pageno also, if needed.

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Вложения

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: drop/truncate table sucks for large values of shared buffers
Следующее
От: Michael Paquier
Дата:
Сообщение: Dereferenced pointer in tablesample.c