Re: Error on pgbench logs - Mailing list pgsql-hackers

From Yugo NAGATA
Subject Re: Error on pgbench logs
Date
Msg-id 20210613032742.6f2ba712e8d86b8db71866f2@sraoss.co.jp
Whole thread Raw
In response to Re: Error on pgbench logs  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: Error on pgbench logs  (Fabien COELHO <coelho@cri.ensmp.fr>)
List pgsql-hackers
On Thu, 10 Jun 2021 23:29:30 +0200 (CEST)
Fabien COELHO <coelho@cri.ensmp.fr> wrote:

> 
> Bonjour Michaël,
> 
> Here is an updated patch. While having a look at Kyotaro-san patch, I 
> noticed that the aggregate stuff did not print the last aggregate. I think 
> that it is a side effect of switching the precision from per-second to 
> per-µs. I've done an attempt at also fixing that which seems to work.

This is just out of curiosity.

+        while ((next = agg->start_time + agg_interval * INT64CONST(1000000)) <= now)

I can find the similar code to convert "seconds" to "us" using casting like

 end_time = threads[0].create_time + (int64) 1000000 * duration;

or
 
 next_report = last_report + (int64) 1000000 * progress;

Is there a reason use INT64CONST instead of (int64)? Do these imply the same effect?

Sorry, if this is a dumb question...

Regards,
Yugo Nagata
 
-- 
Yugo NAGATA <nagata@sraoss.co.jp>



pgsql-hackers by date:

Previous
From: Yugo NAGATA
Date:
Subject: Re: Error on pgbench logs
Next
From: Alvaro Herrera
Date:
Subject: Re: logical replication of truncate command with trigger causes Assert