Re: extend pgbench expressions with functions

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: extend pgbench expressions with functions
Date: 2016-02-12 10:06:02
Message-ID: alpine.DEB.2.10.1602121054140.3116@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Michaël,

> Using a pointer to the tail of the list would make the code simple,
> and save a couple of lines.

I did that, see v27 attached.

Note that it does not save any lines, because the reverse function is
removed, but then you need another type to keep the head & tail, the link
type is not enough, and then you have to manage that stuff in the code.
Whether it is "simpler" is debatable. It probably costs more tests when
executed.

However, it really saves having to answer the question "why is the list
reversed?", which is definitely a win from my point of view:-)

> Another thing that could be considered is also to move list.c [...]

I think that this option is too much bother for the small internal purpose
at hand.

--
Fabien.

Attachment Content-Type Size
pgbench-funcs-27.patch text/x-diff 41.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yury Zhuravlev 2016-02-12 10:39:52 Re: GinPageIs* don't actually return a boolean
Previous Message Amit Kapila 2016-02-12 09:37:14 Re: [COMMITTERS] pgsql: Code cleanup in the wake of recent LWLock refactoring.