From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: [REVIEW] pg_last_xact_insert_timestamp |
Date: | 2011-10-02 21:35:31 |
Message-ID: | 1459.1317591331@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> It occurs to me that pgstat_report_xact_end_timestamp doesn't really
> need to follow the protocol of bumping the change count before and
> after bumping the timestamp. We elsewhere assume that four-byte reads
> and writes are atomic, so there's no harm in assuming the same thing
> here (and if they're not... then the change-count thing is pretty
> dubious anyway). I think it's sufficient to just set the value, full
> stop.
I agree you can read the value without that, but I think that setting
it should still bump the change count. Otherwise there's no way for
another process to collect the whole struct and be sure that it's
self-consistent. We may not have a critical need for that right now,
but it's silly to foreclose the possibility to save a cycle or so.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Simon Riggs | 2011-10-02 22:07:39 | Re: Should we get rid of custom_variable_classes altogether? |
Previous Message | Tom Lane | 2011-10-02 21:32:33 | Re: pg_cancel_backend by non-superuser |