Re: stats_command_string default?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin Brown <kevin(at)sysexperts(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: stats_command_string default?
Date: 2003-02-16 20:55:57
Message-ID: 29115.1045428957@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Kevin Brown <kevin(at)sysexperts(dot)com> writes:
> It's not unmeasurable, but it is reasonably low (guess it depends on
> your definition of "reasonable" :-). I wrote a small perl script
> which would do a "SELECT 1" in a loop as many times as I specified on
> the command line (autocommit was turned off). I measured the amount
> of wall clock time it took to do 100000 passes on an unloaded system
> with stats_command_string enabled, and then the same thing with it
> disabled.

FWIW, I did a comparable test using a slightly more reasonable example
(ie, a query that does useful work): in the regression database,
PREPARE q(int) AS SELECT * FROM tenk1 WHERE unique1 = $1
followed by 10000 executions of
EXECUTE q(42)
This was with autocommit on (ie, each EXECUTE is its own transaction)
and using a C-coded client (a small tweak of src/test/examples/testlibpq.c).

Averaging over three trials on an unloaded system, I got 21.0 seconds
with stats_command_string off, 27.7 with it on, or about 32% overhead.

My conclusion is that stats_command_string overhead is non-negligible
for simple commands. So I stand by my previous opinion that it should
not be turned on without the DBA taking explicit action to turn it on.
Do you want it on in every future benchmark, for example?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2003-02-16 23:05:20 Re: psql and readline
Previous Message Tom Lane 2003-02-16 19:45:01 Re: online reindex

Browse pgsql-patches by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-02-17 01:32:04 Re: stats_command_string default?
Previous Message Tom Lane 2003-02-16 19:26:24 Re: stats_command_string default?