Re: [PATCHES] updated patch for selecting large results

Поиск
Список
Период
Сортировка
От Chris Mair
Тема Re: [PATCHES] updated patch for selecting large results
Дата
Msg-id 1156802374.4026.94.camel@dell.home.lan
обсуждение исходный текст
Ответ на Re: [PATCHES] updated patch for selecting large results sets in  (Chris Mair <chrisnospam@1006.org>)
Ответы Re: [PATCHES] updated patch for selecting large results sets in
Список pgsql-hackers
> Performance-wise I took for granted without checking that GetVariable's
> running time would be negligible.
> 
> [looks at the code]
> 
> I see it's it's basically two function calls with a loop over a linked
> list of values (in the order of 10) doing strcmps and one strtol.
> It is not quite clear to me what the impact of this is. I could
> imagine it would show up only if you perform lots of trivial queries
> through psql. I'm going to benchmark something now and report back.
> 
> Anyway, regardless the benchmark, I feel it's somehow not clean to have
> a variable introduce a difference between "\g" and ";".
> 
> [goes benchmarking...]

Ok,
so I ran a file containing 1 million lines of "select 1;" through
psql (discarding the output). 5 runs each with the patch and with the
patch removed (the if() in SendQuery commented).

These are the results in seconds user time of psql on a Pentium M 2.0
GHz (real time was longer, since the postmaster process was on the same
machine).
patch | count |   avg   |      stddev
-------+-------+---------+-------------------f     |     5 | 16.6722 | 0.359759919946455t     |     5 | 17.2762 |
0.259528803796329

The conclusion is that, yes, the overhead is measurable, albeit with
a very synthetic benchmark (of the type MySQL wins ;).

Basically I'm loosing 0.6 usec on each query line (when FETCH_COUNT
is not there and therefore psql need to scan the whole variables list
in GetVariable() for nothing).

Not sure if that's acceptable (I'd say yes, but then again, I'm
not a cycle counter type of programmer *cough* Java *cough* ;)...

Opinions?

Bye, Chris.


-- 

Chris Mair
http://www.1006.org




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: tsvector/tsearch equality and/or portability issue
Следующее
От: Neil Conway
Дата:
Сообщение: Re: autovacuum causing numerous regression-test failures