Re: pgbench more operators & functions - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench more operators & functions
Date
Msg-id alpine.DEB.2.20.1610041941150.24533@lancre
Whole thread Raw
In response to Re: pgbench more operators & functions  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hello Robert,

> I think it's pretty clear that this patch is not Ready for Committer,

As a reviewer, I do not know when to decide to put something as "ready". 
My opinion is that it is a matter of the reviewer to decide. Whether some 
consensus is actually reached, or whether a committer is going to disagree 
later on, cannot be helped.

> because there's no consensus that we want this, and like Tom and
> Stephen, I'd argue that there are large parts of it we don't want.

> The documentation in the latest patch version mentions XOR and IF
> which we definitely don't want because there is no similar thing in
> SQL,

I have removed these and put CASE WHEN THEN ELSE END instead in v6.

> but in addition to that, I don't think much of an argument has
> been made that any of this is actually useful.

In the TPC-B benchmark, some conditional is needed because under some 
probability an account must be chosen in the *same* branch as the teller, 
otherwise in the *other* branches.

> I'm skeptical about the notion that giving pgbench a vast repertoire of 
> mathematical functions is a good idea.  What does that actually let us 
> do that is useful and not possible today?

I do not see a vast "repertoire" of functions. There are "usual" int 
operators, logical operators, and a few functions.

About the one added in this patch:

bitwise operations: I have seen some use to create a non uniform random 
from a random one. Once one operator is put in, there is no reason not to 
put the others...

exp & ln: could be used to tweak distributions.

conditional: see above.

I have not put trigonometric functions because I could not think of a 
use in a benchmarking context.

> I'm happy to see pgbench made better in a variety of ways, but I don't
> really see why that particular thing is useful.  Perhaps I'm just
> missing something.

I'm trying to add features that are IMO useful for benchmarking.

When doing so, someone says "hay, you put a double expression, you must 
put double variables". Although I can see the point of double expressions 
for passing ints into some transformations, I can't see a double variable 
really useful in any benchmark, but there it is, it is a side effect of 
the process, and it is somehow to have orthogonal features.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Question / requests.
Next
From: Jeff Janes
Date:
Subject: Re: Cache Hash Index meta page.