Re: Fetch statements

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Carlos Benkendorf <carlosbenkendorf(at)yahoo(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Fetch statements
Date: 2005-12-16 18:43:50
Message-ID: 20051216184350.GA7097@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Dec 16, 2005 at 06:28:03PM +0000, Carlos Benkendorf wrote:
> I´m trying to discover some bad SQL statements in our environment
> but the logs are not helping too much... they say we´ve some very
> bad fetch statements but I don´t know how to discover the
> corresponding SELECT statement... How can I find them?

What do you mean by "bad"? Are the statements causing errors, or
are they just taking longer to run than you think they should? The
following log entry suggests the latter.

> Some example:
> <10.0.1.122(3821) 5072 2005-12-16 10:36:12 BRST FETCH>LOG: duration: 1855.818 ms statement: fetch 1 in cur65c

Do your logs contain the DECLARE statement for the cur65c cursor?
If not, are you logging all statements or only those that last
longer than a certain amount of time (log_min_duration_statement)?

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-12-16 18:48:01 Re: Getting a DB password to work without editing pg_hba.conf, possible?
Previous Message Tom Lane 2005-12-16 18:40:20 Re: is this a bug or I am blind?