|From:||Michal J(dot) Kubski <michal(dot)kubski(at)cdt(dot)pl>|
|Subject:||Re: query planning different in plpgsql?|
|Views:||Raw Message | Whole Thread | Download mbox|
On Fri, 23 Oct 2009 16:56:36 +0100, Grzegorz Jaśkiewicz
> On Fri, Oct 23, 2009 at 4:49 PM, Scott Mead
>> Do you not have an index on last_snapshot.domain_id?
> that, and also try rewriting a query as JOIN. There might be difference
Thanks, it runs better (average 240s, not 700s) with the index. Rewriting
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?
I hear and I forget. I see and I believe. I do and I understand.
|Next Message||Merlin Moncure||2009-10-26 13:19:26||Re: query planning different in plpgsql?|
|Previous Message||Marc Mamin||2009-10-26 09:39:48||Re: optimizing query with multiple aggregates|