Re: statement_timeout problem - Mailing list pgsql-general

From Tom Lane
Subject Re: statement_timeout problem
Date
Msg-id 19923.1265070678@sss.pgh.pa.us
Whole thread Raw
In response to statement_timeout problem  ("Hardwick, Joe" <Joe.Hardwick@fnis.com>)
List pgsql-general
"Hardwick, Joe" <Joe.Hardwick@fnis.com> writes:
> I have a problem with fetching from cursors sometimes taking an
> extremely long time to run.  I am attempting to use the
> statement_timeout parameter to limit the runtime on these.

> PostgreSQL 8.2.4
> Linux 2.6.22.14-72.fc6 #1 SMP Wed Nov 21 13:44:07 EST 2007 i686 i686
> i386 GNU/Linux

> begin;
> set search_path = testdb;
> declare cur_rep cursor for select * from accounts, individual;

> set statement_timeout = 1000;

> fetch forward 1000000 from cur_rep;

Works for me --- the FETCH fails after just about a second of execution.

I suspect the problem is lack of a CHECK_FOR_INTERRUPTS someplace, which
probably got added sometime after 8.2.4 (I checked 8.2 branch tip).
I'd suggest updating to 8.2.something-recent.

If you still see the problem in latest 8.2.x then we need to look closer
to figure out why the difference in results.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Locking referenced table when creating and dropping tables with foreign key constraints
Next
From: Ivan Sergio Borgonovo
Date:
Subject: reducing result set of tsvector @@ tsquery avoiding to use ts_rank