Re: add modulo (%) operator to pgbench - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: add modulo (%) operator to pgbench
Date
Msg-id alpine.DEB.2.10.1409242009150.10147@sto
Whole thread Raw
In response to Re: add modulo (%) operator to pgbench  (Kevin Grittner <kgrittn@ymail.com>)
List 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.



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: better atomics - v0.6
Next
From: Andres Freund
Date:
Subject: Re: better atomics - v0.6