From: CS DBA <cs_dba@consistentstate.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: function slower than the same code in an sql file
Date: Thu, 03 Nov 2011 16:42:13 -0600
Message-ID: <4EB318C5.20504@consistentstate.com> (raw)
In-Reply-To: <CA+TgmoYbFUu8drAAgmPjR5Lo9v1TPTyJgOhHrK8yoguZMZWMvQ@mail.gmail.com>
References: <4EAA3597.3020202@consistentstate.com>
<14399.1319778608@sss.pgh.pa.us>
<4EAAB09C.9060202@consistentstate.com>
<CA+TgmoanpOaQS5112U2YBq0b81Ssoxs+MVi-3O+d9ftEKjL7pA@mail.gmail.com>
<4EB2B3EF.60502@estrads.com.ar>
<CA+TgmoYbFUu8drAAgmPjR5Lo9v1TPTyJgOhHrK8yoguZMZWMvQ@mail.gmail.com>
On 11/03/2011 09:40 AM, Robert Haas wrote:
> On Thu, Nov 3, 2011 at 11:31 AM, Rodrigo Gonzalez
> <rjgonzale@estrads.com.ar> wrote:
>> El 03/11/11 11:42, Robert Haas escribió:
>>
>> On Fri, Oct 28, 2011 at 9:39 AM, CS DBA<cs_dba@consistentstate.com> wrote:
>>
>> No parameters, one of them looks like this:
>>
>> [ code snippet ]
>>
>> It's hard to believe this is the real code, because SELECT without
>> INTO will bomb out inside a PL/pgsql function, won't it?
>>
>> But he's using CREATE TABLE xyz_view_m AS
>>
>> So it seems correct to me
> Oh, right, I missed that.
>
> That seems pretty mysterious then. But is it possible the function is
> getting called more times than it should? I notice that it's set up
> as a trigger; is it FOR EACH ROW when it should be a statement-level
> trigger or something like that? Maybe run EXPLAIN ANALYZE on the
> query that's invoking the trigger to get some more detail on what's
> going on?
I'll give it a shot ...
--
---------------------------------------------
Kevin Kempter - Constent State
A PostgreSQL Professional Services Company
www.consistentstate.com
---------------------------------------------
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: cs_dba@consistentstate.com
Subject: Re: function slower than the same code in an sql file
In-Reply-To: <4EB318C5.20504@consistentstate.com>
* 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