Re: suggestion: log_statement = sample

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Janning Vygen <vygen(at)kicktipp(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: suggestion: log_statement = sample
Date: 2009-07-16 13:05:58
Message-ID: 20090716090558.d9292283.wmoran@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In response to Janning Vygen <vygen(at)kicktipp(dot)de>:

> hi,
>
> http://archives.postgresql.org/pgsql-general/2009-03/msg00581.php
>
> This was my suggestion about introducing a statment to get a sample of SQL
> statements. Nobody answered yet. Why not? i think my suggestion would help a
> lot. Or was it kind of stupid?

For my part, I don't think this would be useful.

Since most of your queries are run by software, you're going to see a
fairly predictable pattern to the queries, which means your sampling isn't
going to be anywhere near random, thus it will still be inaccurate and
incomplete.

In my experience, I've found that enabling full logging for a short time
(perhaps a few hours) gathers enough data to run through tools like
pgFouine and find problem areas. Also, we have development servers that
run automated tests, and since it's not critical that they be performant,
we can run full query logging on them all the time. Additionally, we make
sure our production systems have enough hardware behind them that we can
add additional tasks without it affecting production use.

All of these are (in my opinion) better approaches to the problem than
yet another arbitrary query filtering technique. I mean, logging only
the most time-consuming queries is already arbitrary enough (as you
already stated).

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2009-07-16 13:15:56 Re: Working around spurious unique constraint errors due to SERIALIZABLE bug
Previous Message Tom Lane 2009-07-16 12:53:30 Re: [GENERAL] pg_migrator not setting values of sequences?