From: Tom Lane <tgl@sss.pgh.pa.us>
To: Mridula Mahadevan <mmahadevan@stratify.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Queries within a function
Date: Tue, 02 Feb 2010 14:27:59 -0500
Message-ID: <29024.1265138879@sss.pgh.pa.us> (raw)
In-Reply-To: <0A59BA5B590B7E4A8D441196A9F17E904C68825D26@corpmail11.calpurnia.com>
References: <0A59BA5B590B7E4A8D441196A9F17E904C68825D26@corpmail11.calpurnia.com>
Mridula Mahadevan <mmahadevan@stratify.com> writes:
> I am running a bunch of queries within a function, creating some temp tables and populating them. When the data exceeds say, 100k the queries start getting really slow and timeout (30 min). when these are run outside of a transaction(in auto commit mode), they run in a few seconds. Any ideas on what may be going on and any postgresql.conf parameters etc that might help?
I'll bet the function is caching query plans that stop being appropriate
once the table grows in size. You might have to resort to using
EXECUTE, although if you're on 8.4 DISCARD PLANS ought to help too.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, mmahadevan@stratify.com
Subject: Re: Queries within a function
In-Reply-To: <29024.1265138879@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox