Re: Overhead for stats_command_string et al, take 2

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Overhead for stats_command_string et al, take 2
Date: 2006-06-23 13:23:58
Message-ID: 20060623132358.GA7327@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Csaba Nagy 2006-06-23 13:30:45 Re: vacuum, performance, and MVCC
Previous Message Martijn van Oosterhout 2006-06-23 13:14:47 Re: Planning without reason.

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-06-23 16:31:51 Re: Overhead for stats_command_string et al, take 2
Previous Message Mark Kirkwood 2006-06-23 01:51:38 Re: Overhead for stats_command_string et al, take 2