pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Benchmarking Function
3+ messages / 2 participants
[nested] [flat]

* Benchmarking Function
@ 2006-05-20 04:51 David Wheeler <david@kineticode.com>
  2006-05-21 19:23 ` Re: Benchmarking Function Josh Berkus <josh@agliodbs.com>
  0 siblings, 1 reply; 3+ messages in thread

From: David Wheeler @ 2006-05-20 04:51 UTC (permalink / raw)
  To: pgsql-performance

Fellow PostgreSQLers,

With a bit of guidance from Klint Gore, Neil Conway, Josh Berkus, and  
Alexey Dvoychenkov, I have written a PL/pgSQL function to help me  
compare the performance between different functions that execute the  
same task. I've blogged the about the function here:

   http://www.justatheory.com/computers/databases/postgresql/ 
benchmarking_functions.html

My question for the list is: How important is it that I have the  
control in there? In the version I've blogged, the control just  
executes 'SELECT TRUE  FROM generate_series( 1, n)' and iterates  
loops over the results. But I wasn't sure how accurate that was.  
Another approach I've tried it to simply loop without executing a  
query, 'FOR i IN 1..n LOOP', but that takes virtually no time at all.

The idea of the control is, of course, to subtract the overhead of  
the benchmarking function from the code actually being tested. So I  
guess my question is, how important is it to have the control there,  
and, if it is important, how should it actually work?

Many TIA,

David



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Benchmarking Function
  2006-05-20 04:51 Benchmarking Function David Wheeler <david@kineticode.com>
@ 2006-05-21 19:23 ` Josh Berkus <josh@agliodbs.com>
  2006-05-21 22:45   ` Re: Benchmarking Function David Wheeler <david@kineticode.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Josh Berkus @ 2006-05-21 19:23 UTC (permalink / raw)
  To: pgsql-performance; +Cc: David Wheeler <david@kineticode.com>

DW,

> The idea of the control is, of course, to subtract the overhead of  
> the benchmarking function from the code actually being tested. So I  
> guess my question is, how important is it to have the control there,  
> and, if it is important, how should it actually work?

Well, per our conversation the approach doesn't really work.   EXECUTE 
'string' + generate_series seems to carry a substantial and somewhat random 
overhead, between 100ms and 200ms -- enough to wipe out any differences 
between queries.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Benchmarking Function
  2006-05-20 04:51 Benchmarking Function David Wheeler <david@kineticode.com>
  2006-05-21 19:23 ` Re: Benchmarking Function Josh Berkus <josh@agliodbs.com>
@ 2006-05-21 22:45   ` David Wheeler <david@kineticode.com>
  0 siblings, 0 replies; 3+ messages in thread

From: David Wheeler @ 2006-05-21 22:45 UTC (permalink / raw)
  To: Josh Berkus <josh@agliodbs.com>; +Cc: pgsql-performance

On May 21, 2006, at 12:23, Josh Berkus wrote:

> Well, per our conversation the approach doesn't really work.   EXECUTE
> 'string' + generate_series seems to carry a substantial and  
> somewhat random
> overhead, between 100ms and 200ms -- enough to wipe out any  
> differences
> between queries.

Per our conversation I eliminated the EXECUTE 'string' +  
generate_series. Check it out.

   http://theory.kineticode.com/computers/databases/postgresql/ 
benchmarking_functions.html

(Temporary URL; justatheory.com seems to have disappeared from DNS...

Best,

David



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2006-05-21 22:45 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-05-20 04:51 Benchmarking Function David Wheeler <david@kineticode.com>
2006-05-21 19:23 ` Josh Berkus <josh@agliodbs.com>
2006-05-21 22:45   ` David Wheeler <david@kineticode.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox