Re: Usage of epoch in txid_current

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org,Robert Haas <robertmhaas(at)gmail(dot)com>,Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>,Heikki Linnakangas <hlinnaka(at)iki(dot)fi>,Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>,Pg Hackers <pgsql-hackers(at)postgresql(dot)org>,Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Subject: Re: Usage of epoch in txid_current
Date: 2019-06-24 15:26:49
Message-ID: 474A7FBB-70ED-428B-A9D0-F2D8CC57CE73@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On June 24, 2019 8:19:13 AM PDT, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>On Fri, Jun 21, 2019 at 7:01 PM Alexander Korotkov
><a(dot)korotkov(at)postgrespro(dot)ru> wrote:
>> On Thu, Mar 28, 2019 at 8:30 AM Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
>wrote:
>> > Thanks for the reviews! Pushed.
>>
>> Any ideas we should move towards 64-bit xids in more places? That
>has
>> been discussed several times already. I think last time it was
>> discussed in person during FOSDEM PGDay 2018 Developer Meeting [1].
>> There we've discussed that it probably doesn't worth it to change
>> 32-bit on-disk xids in heap. It's better to leave existing heap "as
>> is", but allow other pluggable table access methods to support 64-bit
>> xids. Given now we have pluggable table access methods, we may build
>> a plan on full support of 64-bit xids in core.
>>
>> In my vision sketchy plan may look like this.
>>
>> 1. Change all non-heap types of xids from TransactionId to
>> FullTransactionId.
>
>I think it's fine to replace TransactionId with FullTransactionId
>without stressing about it too much in code that's not that heavily
>trafficked. However, I'm not sure we can do that across the board. For
>example, converting snapshots to use 64-bit XIDs would mean that in
>the worst case a snapshot will use twice as many cache lines, and that
>might have performance implications on some workloads.

We could probably expand the transaction IDs on access or when computing them for most of these, as usually they'll largely be about currently running transactions. It e.g. seems sensible to keep the procarray at 32 bit xids, expand xmin/xmax to 64 when computing snapshots, and leave the snapshot's transaction ID array at 32xids. That ought to be an negligible overhead.

Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-06-24 15:34:01 Re: Misleading comment about single_copy, and some bikeshedding
Previous Message Robert Haas 2019-06-24 15:24:41 Re: allow_system_table_mods stuff