Re: add modulo (%) operator to pgbench

From: Mitsumasa KONDO <kondo(dot)mitsumasa(at)gmail(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add modulo (%) operator to pgbench
Date: 2014-08-07 02:20:16
Message-ID: CADupcHXh1HsKKRBOV+z=UsN6+Yci2pxo5vLysSiOSPySx-VvUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2014-08-06 23:38 GMT+09:00 Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>:

>
> Three different modulo operators seems like a lot for a language that
>> doesn't even have a real expression syntax, but I'll yield to whatever
>> the consensus is on this one.
>>
>
> Here is a third simpler patch which only implements the Knuth's modulo,
> where the remainder has the same sign as the divisor.
>
> I would prefer this version 3 (one simple modulo based on Knuth
> definition) or if there is a problem version 2 (all 3 modulos). Version 1
> which provides a modulo compatible with C & SQL is really useless to me.
>
I like version 3, it is simple and practical. And it's enough in pgbench.
If someone wants to use other implementation of modulo algorithm, he just
changes his source code.

Best regards,
--
Mitsumasa KONDO

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-08-07 03:28:51 Re: postgresql.auto.conf and reload
Previous Message Bruce Momjian 2014-08-07 01:35:16 Re: Partitioning performance: cache stringToNode() of pg_constraint.ccbin