Re: Error on pgbench logs

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, rulyox(at)gmail(dot)com, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Error on pgbench logs
Date: 2021-06-12 21:32:54
Message-ID: alpine.DEB.2.22.394.2106122329050.479449@pseudo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> + 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?

I guess that the macros does 1000000LL or something similar to directly
create an int64 constant. It is necessary if the constant would overflow a
usual 32 bits C integer, whereas the cast is sufficient if there is no
overflow. Maybe I c/should have used the previous approach.

> Sorry, if this is a dumb question...

Nope.

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-06-12 21:40:38 Re: BUG #17056: Segmentation fault on altering the type of the foreign table column with a default
Previous Message Andrew Dunstan 2021-06-12 21:29:09 Re: Race condition in recovery?