Re: transaction wraparound

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Павел Ерёмин <shnoor111gmail(at)yandex(dot)ru>, pgsql-novice(at)postgresql(dot)org
Subject: Re: transaction wraparound
Date: 2019-10-31 18:59:36
Message-ID: 3851beb5088b05df17862ea70bc90e92a37c1d8a.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thu, 2019-10-31 at 10:15 +0300, Павел Ерёмин wrote:
> I have a question about transaction wraparound. As far as I know, transaction
> numbers are 32 bit, which greatly limits their number. In the tuple header
> there are now t_xmin and t_xmax fields -
> both 32 bits each. So why not replace them with a single field with a transaction
> number of 64 bits length - this is the transaction number that created the version
> ( this is exactly what the MS SQL server does)? In this case, you do not have to
> lengthen header tuple. Of course, this can result in increased I/O, so to
> compensate for it, you can turn off buffered read (O_DIRECT) while reading.

This is certainly well-intended, but you got several things wrong:

- *both* xmin and xmax contain a transaction number, the first is the
transaction that created the tuple, the second the transaction that
marked it invalid.

- Apart from the above, I don't see how this or using direct I/O
would affect the I/O load.

There is certainly room for improvement, and 64-bit txid's would be nice,
but a lot of smart people who understand PostgreSQL well have already
racked their brains on questions like this, so if there were a simple,
obvious solution, it would probably already have been implemented.

You should search the hacker's list archives for previous discussions
about extending the txid counter, that will be instructive.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Marcel Ruff 2019-11-04 07:29:47 PostgreSQL 12 crash with segmentation violation
Previous Message Andreas Kretschmer 2019-10-31 10:14:06 Re: transaction wraparound