Re: Overhead for stats_command_string et al, take 2 - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Overhead for stats_command_string et al, take 2
Date
Msg-id 20060623132358.GA7327@alvh.no-ip.org
Whole thread Raw
In response to Overhead for stats_command_string et al, take 2  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Overhead for stats_command_string et al, take 2  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> I redid my previous measurements after finishing up the weekend's
> hacking.  The numbers shown below are elapsed time in seconds for
> 
>     time psql -f testfile.sql postgres >/dev/null

Average of 5 runs, for the first two cases, on the x86 machine that
shows high overhead in gettimeofday.

I used only 30000 SELECT 1 queries instead of 100k.

30000 SELECT 1;        HEAD        8.1
no overhead        21.9        23.1    
stats_command_string=1    22.4        36.6

BEGIN; 30000 SELECT 1; COMMIT;        HEAD        8.1
no overhead        19.1        20.3
stats_command_string=1    19.4        30.3

It can be observed that HEAD in the no overhead case is actually faster
than 8.1 on this machine.   And while stats_command_string adds some
overhead, it still is faster than the no overhead case in 8.1.  (These
results took me by surprise actually.)

For the curious, here are medians and averages for each run ("file3" is
the plain SELECT, while "file4" is BEGIN-30k * SELECT-COMMIT.  "caso1"
is no overhead, "caso2" is stats_command_string=1).  I couldn't find a
quick'n dirty way to calculate stddev in shell but if anyone knows one
let me know.
    median  average
8.1-file3-caso1: 23.098 23.145
8.1-file3-caso2: 36.595 36.607
8.1-file4-caso1: 20.304 20.269
8.1-file4-caso2: 30.169 30.256
head-file3-caso1: 21.890 21.931
head-file3-caso2: 22.509 22.390
head-file4-caso1: 19.142 19.126
head-file4-caso2: 19.488 19.442

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Planning without reason.
Next
From: Csaba Nagy
Date:
Subject: Re: vacuum, performance, and MVCC