public inbox for [email protected]  
help / color / mirror / Atom feed
From: Fujii Masao <[email protected]>
To: Ken Kato <[email protected]>
To: [email protected]
Subject: Re: [PATCH] Add min() and max() aggregate functions for xid8
Date: Sat, 5 Feb 2022 00:30:26 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>



On 2022/02/03 16:45, Ken Kato wrote:
> Hi hackers,
> 
> Unlike xid, xid8 increases monotonically and cannot be reused.
> This trait makes it possible to support min() and max() aggregate functions for xid8.
> I thought they would be useful for monitoring.
> 
> So I made a patch for this.

Thanks for the patch! +1 with this feature.

+	PG_RETURN_FULLTRANSACTIONID((U64FromFullTransactionId(fxid1) > U64FromFullTransactionId(fxid2)) ? fxid1 : fxid2);

Shouldn't we use FullTransactionIdFollows() to compare those two fxid values here, instead?

+	PG_RETURN_FULLTRANSACTIONID((U64FromFullTransactionId(fxid1) < U64FromFullTransactionId(fxid2)) ? fxid1 : fxid2);

Shouldn't we use FullTransactionIdPrecedes() to compare those two fxid values here, instead?

Could you add the regression tests for those min() and max() functions for xid8?

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION






view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Add min() and max() aggregate functions for xid8
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox