Re: Logging long queries: not all get logged

From: Chris Browne <cbbrowne(at)acm(dot)org>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Logging long queries: not all get logged
Date: 2006-05-10 19:28:02
Message-ID: 60mzdpaddp.fsf@dba2.int.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

ogjunk-pgjedan(at)yahoo(dot)com writes:
> Hi,
>
> I'm running PG 8.0.3. I'm trying to catch slow queries, so I have this in postgresql.conf:
>
> # log queries that take more than 500 ms
> log_min_duration_statement = 500 # in ms
>
> This does log _some_ queries that take > 500 ms to run.
> However, it looks like not all queries get logged!
>
> And I think I spotted a pattern:
>
> Queries that DO get logged are:
> - queries run using psql
> - queries run by the java app that uses JDBC to talk to my PG database
>
> Queries that do NOT get logged are:
> - queries run by the java app that uses Hibernate to talk to my PG database

We occasionally have run into seemingly the same issue.

Question:

Are you certain that the queries are taking longer than 500ms for
PostgreSQL to process them?

Or are you merely certain that Hibernate is reporting that it took
longer than that for *it* to process them?

We have had Java applications which would report spurious "slow"
queries any time the garbage collector had to do any significant
amount of work.

It could be that the garbage collector is causing Hibernate to stall
while processing its logging, thereby incorrectly reporting that
database queries are running slow...
--
(reverse (concatenate 'string "gro.gultn" "@" "enworbbc"))
http://cbbrowne.com/info/finances.html
The only problem
with Haiku is that you just
get started and then

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Marlowe 2006-05-10 19:35:14 Re: backups
Previous Message Bruno Wolff III 2006-05-10 19:11:38 Re: backups