Re: add modulo (%) operator to pgbench

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add modulo (%) operator to pgbench
Date: 2014-09-24 18:24:42
Message-ID: alpine.DEB.2.10.1409242009150.10147@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> No, it depends totally on the application. For financial and
> physical inventory purposes where I have had occasion to use it,
> the properties which were important were:
> [...]

Hmmm. Probably I'm biased towards my compiler with an integer linear
flavor field, where C-like "%" is always a pain, however you look at it.

I'm not sure of physical inventories with negative numbers though. In
accounting, I thought that a negative number was a positive number with
"debit" written above. In finance, no problem to get big deficits:-)

Now about the use case, I'm not sure that you would like to write your
financial and physical inventory stuff within a pgbench test script,
whereas in such a script I do expect when doing a modulo with the size of
a table to have a positive result so that I can expect to find a tuple
there, hence the desired "positive remainder" property for negative
dividends.

--
Fabien.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-09-24 18:27:39 Re: better atomics - v0.6
Previous Message Heikki Linnakangas 2014-09-24 18:19:06 Re: better atomics - v0.6