Re: Why does txid_current() assign new transaction-id?

Поиск
Список
Период
Сортировка
От Christoph Berg
Тема Re: Why does txid_current() assign new transaction-id?
Дата
Msg-id 20150526172714.GF15206@msg.df7cb.de
обсуждение исходный текст
Ответ на Re: Why does txid_current() assign new transaction-id?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Why does txid_current() assign new transaction-id?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Re: Tom Lane 2015-05-26 <14207.1432650862@sss.pgh.pa.us>
> Naoya Anzai <nao-anzai@xc.jp.nec.com> writes:
> > I have a question about txid_current().
> > it is "Why does txid_current() assign new transaction-id?".
> 
> Consider
> 
>     begin;
>     select txid_current();
>     insert into my_table ...;
>     commit;
> 
> If we changed the code as you propose, the result of the SELECT would
> no longer have anything to do with the XID used for the insertion.

Still, exposing GetStableLatestTransactionId() on the SQL level would
make sense for monitoring transaction throughput. Currently if you do
that with txid_current(), you'll generate an (low, but measurable)
transaction load of 1/monitoring interval.

Christoph
-- 
cb@df7cb.de | http://www.df7cb.de/



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: fsync-pgdata-on-recovery tries to write to more files than previously
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why does txid_current() assign new transaction-id?