Re: pg_last_xact_insert_timestamp
| От | Fujii Masao |
|---|---|
| Тема | Re: pg_last_xact_insert_timestamp |
| Дата | |
| Msg-id | CAHGQGwEsMSOCmgeOVte5WwHgPTXNr=2aYSDjSQi9f28UBXRT9Q@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: pg_last_xact_insert_timestamp (Robert Haas <robertmhaas@gmail.com>) |
| Ответы |
[REVIEW] pg_last_xact_insert_timestamp
|
| Список | pgsql-hackers |
On Sat, Sep 10, 2011 at 12:32 AM, Robert Haas <robertmhaas@gmail.com> wrote: > On Thu, Sep 8, 2011 at 8:42 PM, Fujii Masao <masao.fujii@gmail.com> wrote: >> Another idea to avoid spinlock contention is save the timestamp in >> PgBackendStatus (which contains information for pg_stat_activity). >> This enables us to write and read the timestamp without spinlock. >> Comments? > > That seems like a possibly promising approach, in that each backend > could update the information separately, and it's the reader's job to > go find the maximum of all those values when needed. So the overhead > is (properly, in this case) placed on the reader instead of the > writer. But it's a bit tricky, because when the reader wants that > maximum, it has to take into account inactive backends that may have > committed transactions before exiting, not just the ones that are > still connected. Yes, that's what I was thinking. The attached patch has adopted that approach. Regards, -- Fujii Masao NIPPON TELEGRAPH AND TELEPHONE CORPORATION NTT Open Source Software Center
Вложения
В списке pgsql-hackers по дате отправления: