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:
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?
pgsql-performance by date
|Next:||From: Brendan Duddridge||Date: 2006-05-21 08:21:55|
|Subject: Performs WAY better with enable_seqscan = off|
|Previous:||From: Kenji Morishige||Date: 2006-05-20 02:37:45|
|Subject: utilizing multiple disks for i/o performance|