pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Wheeler <david@kineticode.com>
To: pgsql-performance <pgsql-performance@postgresql.org>
Subject: Benchmarking Function
Date: Fri, 19 May 2006 21:51:30 -0700
Message-ID: <1D5FC47D-8D90-4856-8EB7-833476A37587@kineticode.com> (raw)

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



view thread (3+ messages)  latest in thread

Message-ID: <1D5FC47D-8D90-4856-8EB7-833476A37587@kineticode.com>
Permalink:  ../1D5FC47D-8D90-4856-8EB7-833476A37587@kineticode.com/
Also on:    postgresql.org/message-id/1D5FC47D-8D90-4856-8EB7-833476A37587@kineticode.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: david@kineticode.com
  Subject: Re: Benchmarking Function
  In-Reply-To: <1D5FC47D-8D90-4856-8EB7-833476A37587@kineticode.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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