Re: pgbench stats per script & other stuff

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench stats per script & other stuff
Date: 2016-03-04 17:31:59
Message-ID: alpine.DEB.2.10.1603041827490.11128@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Alvaro,

> I looked at 19.d and I think the design has gotten pretty convoluted. I
> think we could simplify with the following changes:
>
> struct script_t gets a new member, of type Command **, which is
> initially null.
>
> function process_builtin receives the complete script_t (not individual
> memebers of it) constructs the Command ** array and puts it in
> script_t's new member; return value is the same script_t struct it got
> (except it's now augmented with the Command **array).
>
> function process_file constructs a new script_t from the string list,
> creates its Command **array just like process_builtin and returns the
> constructed struct.
>
> function addScript receives script_t instead of individual members of
> it, and does the appropriate thing.

Why not. Here are two versions:

*-20.patch is the initial rebased version

*-21.patch does what you suggested above, some hidden awkwardness
but much less that the previous one.

--
Fabien

Attachment Content-Type Size
pgbench-script-stats-20.patch text/x-diff 12.9 KB
pgbench-script-stats-21.patch text/x-diff 16.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2016-03-04 17:41:23 Re: pgbench small bug fix
Previous Message Robert Haas 2016-03-04 17:30:19 Re: Incorrect error message in InitializeSessionUserId