Re: tracking commit timestamps

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Steve Singer <steve(at)ssinger(dot)info>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Anssi Kääriäinen <anssi(dot)kaariainen(at)thl(dot)fi>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Subject: Re: tracking commit timestamps
Date: 2014-11-10 13:39:09
Message-ID: 5460BFFD.1040207@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-www

On 09/11/14 17:57, Steve Singer wrote:
> On 11/07/2014 07:07 PM, Petr Jelinek wrote:
>> The list of what is useful might be long, but we can't have everything
>> there as there are space constraints, and LSN is another 8 bytes and I
>> still want to have some bytes for storing the "origin" or whatever you
>> want to call it there, as that's the one I personally have biggest
>> use-case for.
>> So this would be ~24bytes per txid already, hmm I wonder if we can
>> pull some tricks to lower that a bit.
>>
>
> The reason why Jim and myself are asking for the LSN and not just the
> timestamp is that I want to be able to order the transactions. Jim
> pointed out earlier in the thread that just ordering on timestamp allows
> for multiple transactions with the same timestamp.
>
> Maybe we don't need the entire LSN to solve that. If you already have
> the commit timestamp maybe you only need another byte or two of
> granularity to order transactions that are within the same microsecond.
>

Hmm maybe just one part of LSN, but I don't really like that either, if
we want to store LSN we should probably store it as is as somebody might
want to map it to txid for other reasons.

I did the calculation above wrong btw, it's actually 20 bytes not 24
bytes per record, I am inclined to just say we can live with that.

Since we agreed that the (B) case is not really feasible and we are
doing the (C), I also wonder if extradata should be renamed to nodeid
(even if it's not used at this point as nodeid). And then there is
question about the size of it, since the nodeid itself can live with 2
bytes probably ("64k of nodes ought to be enough for everybody" ;) ).
Or leave the extradata as is but use as reserved space for future use
and not expose it at this time on SQL level at all?

I guess Andres could answer what suits him better here.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-11-10 13:40:04 Re: tracking commit timestamps
Previous Message Robert Haas 2014-11-10 13:26:17 Re: tracking commit timestamps

Browse pgsql-www by date

  From Date Subject
Next Message Alvaro Herrera 2014-11-10 13:40:04 Re: tracking commit timestamps
Previous Message Robert Haas 2014-11-10 13:26:17 Re: tracking commit timestamps