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 18:34:11
Message-ID: alpine.DEB.2.10.1603041921320.11128@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>> *-21.patch does what you suggested above, some hidden awkwardness
>> but much less that the previous one.
>
> Yeah, I think this is much nicer, don't you agree?

Yep, I said "less awkwarness than previous", a pretty contrived way to say
better:-)

> However, this is still a bit broken -- you cannot return a stack
> variable from process_file, because the stack goes away once the
> function returns. You need to malloc it.

That is why the "fs" variable in process_file is declared "static", and
why I wrote "some hidden awkwarness".

I did want to avoid a malloc because then who would free the struct?
addScript cannot to it systematically because builtins are static. Or it
would have to create an on purpose struct, but I then that would be more
awkwarness, and malloc/free to pass arguments between functions is not
efficient nor very elegant.

So the "static" option looked like the simplest & most elegant version.

> Also, you forgot to update the comments in process_file,
> process_builtin, etc.

Indeed. v22 attached with better comments.

--
Fabien.

Attachment Content-Type Size
pgbench-script-stats-22.patch text/x-diff 16.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2016-03-04 18:41:57 Re: pgbench stats per script & other stuff
Previous Message Robert Haas 2016-03-04 18:27:35 Re: More stable query plans via more predictable column statistics