Re: query planning different in plpgsql?

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: "Michal J(dot) Kubski" <michal(dot)kubski(at)cdt(dot)pl>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: query planning different in plpgsql?
Date: 2009-10-26 13:19:26
Message-ID: b42b73150910260619l7727208v3dce371aaec6a562@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Oct 26, 2009 at 6:05 AM, Michal J. Kubski <michal(dot)kubski(at)cdt(dot)pl> wrote:
> On Fri, 23 Oct 2009 16:56:36 +0100, Grzegorz Jaśkiewicz
> <gryzman(at)gmail(dot)com> wrote:
>> On Fri, Oct 23, 2009 at 4:49 PM, Scott Mead
>> <scott(dot)lists(at)enterprisedb(dot)com>wrote:
>>
>>>
>>>
>>>   Do you not have an index on last_snapshot.domain_id?
>>>
>>
>> that, and also try rewriting a query as JOIN. There might be difference
> in
>> performance/plan.
>>
> Thanks, it runs better (average 240s, not 700s) with the index. Rewriting
> queries
> as JOINs does not make any difference.
> The last_snapshot is a temp table created earlier in the procedure
> and the query in question is preceded with CREATE TEMPORARY TABLE as well,
> not a cursor.
> I still do not get why it performs differently inside the procedure.
> Is there any way to see what planning decisions were made?

not directly....can we see the function?

merlin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Michal J. Kubski 2009-10-26 13:50:00 Re: query planning different in plpgsql?
Previous Message Michal J. Kubski 2009-10-26 10:05:23 Re: query planning different in plpgsql?