Assessing performance of fetches

From: John Rouillard <rouilj(at)renesys(dot)com>
To: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Assessing performance of fetches
Date: 2011-04-18 18:12:41
Message-ID: 20110418181241.GF27218@renesys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi all:

An application running against a postgres 8.4.5 database under CentOS
5.5 uses cursors (I think via SqlAlchemy). To look for database
performance issues I log any query that takes > 2 seconds to complete.

I am seeing:

2011-04-16 00:55:33 UTC user(at)database(3516): LOG: duration:
371954.811 ms statement: FETCH FORWARD 1 FROM c_2aaaaaaeea50_a08

While I obviously have a problem here, is there any way to log the
actual select associated with the cursor other than logging all
statements?

Also once I have the select statement, does the fact that is is
associated with a fetch/cursor change the steps I should take in
tuning it compared to somebody just issuing a normal select?

Thanks for any ideas.

--
-- rouilj

John Rouillard System Administrator
Renesys Corporation 603-244-9084 (cell) 603-643-9300 x 111

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2011-04-18 18:27:27 Re: Select in subselect vs select = any array
Previous Message Uwe Bartels 2011-04-18 17:13:28 Re: big distinct clause vs. group by