Re: extend pgbench expressions with functions

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: extend pgbench expressions with functions
Дата
Msg-id 55B0A66A.8030403@iki.fi
обсуждение исходный текст
Ответ на Re: extend pgbench expressions with functions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: extend pgbench expressions with functions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: extend pgbench expressions with functions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
On 03/06/2015 11:41 AM, Fabien COELHO wrote:
> This patch extends pgbench expression with functions. Currently only one
> "abs" function is added. The point is rather to bootstrap the
> infrastructure for other functions (such as hash, random variants...) to
> be added later.

I think it would actually be good to add at least some of those other 
functions in the initial patch. The infrastructure that this patch adds 
only supports arguments with a single argument, so it won't get us very 
far. Also, will we need non-integer (e.g. string, numeric, whatever) 
arguments for the functions? How about other datatypes for variables in 
general? Perhaps not, or if we do that can be a separate patch, but it's 
something to keep in mind. The pgbench script language is evolving into 
a full-blown Turing-complete programming language...

As an initial list of functions, I'd suggest:

abs(x)
min(x, y, ...)
max(x, y, ...)
random_uniform(min, max)
random_gaussian(min, max, threshold)
random_exponential(min, max, threshold)

Would that be enough to specify e.g. the

As soon as we add more functions, the way they are documented needs to 
be reworked too; we'll need to add a table in the manual to list them.

- Heikki




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Idea: closing the loop for "pg_ctl reload"
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: WAL logging problem in 9.4.3?