X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 18F529FA3A6 for ; Wed, 10 May 2006 20:24:42 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 47916-06 for ; Wed, 10 May 2006 20:24:37 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web50302.mail.yahoo.com (web50302.mail.yahoo.com [206.190.38.56]) by postgresql.org (Postfix) with SMTP id 472089FA3A3 for ; Wed, 10 May 2006 20:24:37 -0300 (ADT) Received: (qmail 95627 invoked by uid 60001); 10 May 2006 23:24:35 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=HWg8OVTEHy+ywOvHDss0OMdzVfGGjRZl8n+A9JJKoheJBx34CwygxyAQ0oHhiyCmU1BxITw4sy9LlAHOY/u0Yc8Xi51kkBEoFzgeFpzIF41z32lD7cSF+MiH6c8dQWX111raYxSVzw+gVXhiVDs8BicSzjBFjUHI6puNVj7kL/E= ; Message-ID: <20060510232435.95625.qmail@web50302.mail.yahoo.com> Date: Wed, 10 May 2006 16:24:35 -0700 (PDT) From: Subject: Re: Logging long queries: not all get logged To: pgsql-admin@postgresql.org In-Reply-To: <60mzdpaddp.fsf@dba2.int.libertyrms.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.343 tagged_above=0 required=5 tests=AWL, BAYES_00, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_WHOIS, FORGED_YAHOO_RCVD, NO_REAL_NAME X-Spam-Level: * X-Archive-Number: 200605/125 X-Sequence-Number: 21657 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 To: pgsql-admin@postgresql.org Sent: Wednesday, May 10, 2006 3:28:02 PM Subject: Re: [ADMIN] Logging long queries: not all get logged ogjunk-pgjedan@yahoo.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 ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings