Re: [REVIEW] pg_last_xact_insert_timestamp

Fujii Masao <masao.fujii@gmail.com>

From: Fujii Masao <masao.fujii@gmail.com>
To: Simon Riggs <simon@2ndquadrant.com>
Cc: Kyotaro HORIGUCHI <horiguchi.kyotaro@oss.ntt.co.jp>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2011-10-03T09:56:53Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Treat 2PC commit/abort the same as regular xacts in recovery.

On Fri, Sep 30, 2011 at 4:18 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> If we want to measure times, we can easily send regular messages into
> WAL to provide this function. Using checkpoint records would seem
> frequent enough to me. We don't always send checkpoint records but we
> can send an info message instead if we are streaming. If
> archive_timeout is not set and max_wal_senders > 0 then we can send an
> info WAL message with timestamp on a regular cycle.

What timestamp are you thinking the walsender should send? What we need
is the timestamp which is comparable with the result of
pg_last_xact_replay_timestamp() which returns the timestamp of the
transaction commit or abort record. So, even if we adopt your proposal,
ISTM that we still need to collect the timestamp for each commit. No?

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center