pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedsetting configuration values inside a stored proc
3+ messages / 2 participants
[nested] [flat]
* setting configuration values inside a stored proc
@ 2011-05-12 23:10 Samuel Gendler <sgendler@ideasculptor.com>
2011-05-13 08:28 ` Re: setting configuration values inside a stored proc Andres Freund <andres@anarazel.de>
0 siblings, 1 reply; 3+ messages in thread
From: Samuel Gendler @ 2011-05-12 23:10 UTC (permalink / raw)
To: pgsql-performance
I've got a stored proc that constructs some aggregation queries as strings
and then executes them. I'd like to be able to increase work_mem before
running those queries. If I set a new value for work_mem within the stored
proc prior to executing my query string, will that actually have an impact
on the query or is work_mem basically a constant once the outer statement
that calls the stored proc has begun? I'd just test, but it will take hours
for me to grab a copy of production data and import into a new db host for
testing. I've already started that process, but I'm betting I'll have an
answer by the time it completes. It's just the difference between modifying
the application which calls the procs (and doing a full software release in
order to do so or else waiting a month to go in the next release) vs
modifying the procs themselves, which requires only db a update.
--sam
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: setting configuration values inside a stored proc
2011-05-12 23:10 setting configuration values inside a stored proc Samuel Gendler <sgendler@ideasculptor.com>
@ 2011-05-13 08:28 ` Andres Freund <andres@anarazel.de>
2011-05-13 09:41 ` Re: setting configuration values inside a stored proc Samuel Gendler <sgendler@ideasculptor.com>
0 siblings, 1 reply; 3+ messages in thread
From: Andres Freund @ 2011-05-13 08:28 UTC (permalink / raw)
To: pgsql-performance; +Cc: Samuel Gendler <sgendler@ideasculptor.com>
Hi,
On Friday, May 13, 2011 01:10:19 AM Samuel Gendler wrote:
> I've got a stored proc that constructs some aggregation queries as strings
> and then executes them. I'd like to be able to increase work_mem before
> running those queries. If I set a new value for work_mem within the stored
> proc prior to executing my query string, will that actually have an impact
> on the query or is work_mem basically a constant once the outer statement
> that calls the stored proc has begun? I'd just test, but it will take
> hours for me to grab a copy of production data and import into a new db
> host for testing. I've already started that process, but I'm betting I'll
> have an answer by the time it completes. It's just the difference between
> modifying the application which calls the procs (and doing a full software
> release in order to do so or else waiting a month to go in the next
> release) vs modifying the procs themselves, which requires only db a
> update.
I would suggest doing ALTER FUNCTION blub(blarg) SET work_mem = '512MB';
Andres
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: setting configuration values inside a stored proc
2011-05-12 23:10 setting configuration values inside a stored proc Samuel Gendler <sgendler@ideasculptor.com>
2011-05-13 08:28 ` Re: setting configuration values inside a stored proc Andres Freund <andres@anarazel.de>
@ 2011-05-13 09:41 ` Samuel Gendler <sgendler@ideasculptor.com>
0 siblings, 0 replies; 3+ messages in thread
From: Samuel Gendler @ 2011-05-13 09:41 UTC (permalink / raw)
To: Andres Freund <andres@anarazel.de>; +Cc: pgsql-performance
On Fri, May 13, 2011 at 1:28 AM, Andres Freund <andres@anarazel.de> wrote:
> Hi,
>
> On Friday, May 13, 2011 01:10:19 AM Samuel Gendler wrote:
>
> I would suggest doing ALTER FUNCTION blub(blarg) SET work_mem = '512MB';
>
>
Ah! That's perfect and very convenient. Thanks.
--sam
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2011-05-13 09:41 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-05-12 23:10 setting configuration values inside a stored proc Samuel Gendler <sgendler@ideasculptor.com>
2011-05-13 08:28 ` Andres Freund <andres@anarazel.de>
2011-05-13 09:41 ` Samuel Gendler <sgendler@ideasculptor.com>
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