Hi Chris, 

I'm pretty sure (I do no timing on the Hibernate/java/app side).  I changed the 
config to:

# log queries that take more than 1 ms
log_min_duration_statement = 1       # in ms

Still nothing in the log :) (I did ctl_reload the postmaster)

Simon Riggs confirmed this is a known bug in another email, and 8.1.* should 
contain a fix.  Good excuse to move to 8.0*.
Or does anyone know if 8.2 is around the corner? (coming in days or a few 
weeks?)

Thanks,
Otis


----- Original Message ----
From: Chris Browne <[EMAIL PROTECTED]>
To: pgsql-admin@postgresql.org
Sent: Wednesday, May 10, 2006 3:28:02 PM
Subject: Re: [ADMIN] Logging long queries: not all get logged

[EMAIL PROTECTED] 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 

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings




---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to