Re: Is monotonous xid8 is a right way to do? - Mailing list pgsql-hackers

From Dagfinn Ilmari Mannsåker
Subject Re: Is monotonous xid8 is a right way to do?
Date
Msg-id 87tubdouf2.fsf@wibble.ilmari.org
Whole thread Raw
In response to Is monotonous xid8 is a right way to do?  (Pavel Borisov <pashkin.elfe@gmail.com>)
Responses Re: Is monotonous xid8 is a right way to do?  (Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>)
List pgsql-hackers
Pavel Borisov <pashkin.elfe@gmail.com> writes:

> Hi hackers!
>
> Now we have two data types xid and xid8. The first one (xid) makes a
> numeric ring, and xid8 are monotonous.
>
> As per [1] "Unlike xid values, xid8 values increase strictly monotonically
> and cannot be reused in the lifetime of a database cluster."
>
> As a consequence of [1] xid8 can have min/max functions (committed in [2]),
> which xid can not have.
>
> When working on 64xid patch [3] we assume that even 64xid's technically can
> be wraparound-ed, although it's very much unlikely. I wonder what is
> expected to be with xid8 values at this (unlikely) 64xid wraparound?

Even if a cluster was consuming a million XIDs per second, it would take
over half a million years to wrap around the 64bit range. Is that really
something we should worry about?

ilmari@[local]:5432 ~=# select 2::numeric^64/10^9/3600/24/365;
┌──────────────────┐
│     ?column?     │
├──────────────────┤
│ 584942.417355072 │
└──────────────────┘

- ilmari



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Skipping logical replication transactions on subscriber side
Next
From: Maxim Orlov
Date:
Subject: Re: Is monotonous xid8 is a right way to do?