Unix Technical Forum

Benchmarking Function

This is a discussion on Benchmarking Function within the Pgsql Performance forums, part of the PostgreSQL category; --> Fellow PostgreSQLers, With a bit of guidance from Klint Gore, Neil Conway, Josh Berkus, and Alexey Dvoychenkov, I have ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 08:50 AM
David Wheeler
 
Posts: n/a
Default Benchmarking Function

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...es/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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 08:50 AM
Josh Berkus
 
Posts: n/a
Default Re: Benchmarking Function

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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 08:50 AM
David Wheeler
 
Posts: n/a
Default Re: Benchmarking Function

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/compute...es/postgresql/
benchmarking_functions.html

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

Best,

David

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:39 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com