Re: [REVIEW] pg_last_xact_insert_timestamp

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(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: 2014-08-11 07:46:23
Message-ID: 20140811074623.GA5999@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2011-10-04 20:52:59 +0900, Fujii Masao wrote:
> *** a/src/backend/access/transam/xact.c
> --- b/src/backend/access/transam/xact.c
> ***************
> *** 1066,1071 **** RecordTransactionCommit(void)
> --- 1066,1074 ----
>
> (void) XLogInsert(RM_XACT_ID, XLOG_XACT_COMMIT_COMPACT, rdata);
> }
> +
> + /* Save timestamp of latest transaction commit record */
> + pgstat_report_xact_end_timestamp(xactStopTimestamp);
> }
>

Perhaps that pgstat_report() should instead be combined with the
pgstat_report_xact_timestamp(0) in CommitTransaction()? Then the number
of changecount increases and cacheline references would stay the
same. The only thing that'd change would be a single additional
assignment.

Greetings,

Andres Freund

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message worthy7 2014-08-11 09:17:56 Re: nulls in GIN index
Previous Message Michael Paquier 2014-08-11 07:38:33 Re: Support for N synchronous standby servers