Re: pgbench stats per script & other stuff

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: pgbench stats per script & other stuff
Дата
Msg-id alpine.DEB.2.10.1603041921320.11128@sto
обсуждение исходный текст
Ответ на Re: pgbench stats per script & other stuff  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: pgbench stats per script & other stuff  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список 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.

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: More stable query plans via more predictable column statistics
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pgbench stats per script & other stuff