Re: Add last commit LSN to pg_last_committed_xact()

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Add last commit LSN to pg_last_committed_xact()
Дата
Msg-id CA+TgmoZiY3aRMG_vtOpELqsnYiiStiG=SUqkHJ3KCLSWwsZjxA@mail.gmail.com
обсуждение исходный текст
Ответ на Add last commit LSN to pg_last_committed_xact()  (James Coleman <jtc331@gmail.com>)
Ответы Re: Add last commit LSN to pg_last_committed_xact()  (James Coleman <jtc331@gmail.com>)
Список pgsql-hackers
On Fri, Jan 14, 2022 at 7:42 PM James Coleman <jtc331@gmail.com> wrote:
> I've attached a simple patch (sans tests and documentation) to get
> feedback early. After poking around this afternoon it seemed to me
> that the simplest approach was to hook into the commit timestamps
> infrastructure and store the commit's XLogRecPtr in the cache of the
> most recent value (but of course don't write it out to disk). That the
> downside of making this feature dependent on "track_commit_timestamps
> = on", but that seems reasonable:
>
> 1. Getting the xid of the last commit is similarly dependent on commit
> timestamps infrastructure.
> 2. It's a simple place to hook into and avoids new shared data and locking.
>
> Thoughts?

It doesn't seem great to me. It's making commit_ts do something other
than commit timestamps, which looks kind of ugly.

In general, I'm concerned about the cost of doing something like this.
Extra shared memory updates as part of the process of committing a
transaction are not (and can't be made) free.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Adding CI to our tree
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: a misbehavior of partition row movement (?)