Re: Query much slower when run from postgres function

From: decibel <decibel(at)decibel(dot)org>
To: Mario Splivalo <mario(dot)splivalo(at)megafon(dot)hr>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query much slower when run from postgres function
Date: 2009-03-14 14:31:31
Message-ID: 5005AE34-7085-499B-8B4A-B4F5AD69B183@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-performance

On Mar 9, 2009, at 8:36 AM, Mario Splivalo wrote:
> Now, as I was explained on pg-jdbc mailinglist, that 'SET
> enable_seqscan TO false' affects all queries on that persistent
> connection from tomcat, and It's not good solution. So I wanted to
> post here to ask what other options do I have.

FWIW, you can avoid that with SET LOCAL (though it would still affect
the rest of the transaction).

You could also store whatever enable_seqscan was set to in a variable
before setting it to false and then set it back when you're done.
--
Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message decibel 2009-03-14 14:42:22 Re: Query much slower when run from postgres function
Previous Message Dave Cramer 2009-03-14 02:53:36 Re: Postgres transaction error

Browse pgsql-performance by date

  From Date Subject
Next Message decibel 2009-03-14 14:42:22 Re: Query much slower when run from postgres function
Previous Message Simon Riggs 2009-03-14 13:30:02 Re: Proposal of tunable fix for scalability of 8.4