Re: query planning different in plpgsql?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 18:09:49
Message-ID: 13574.1256580589@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Michal J. Kubski" <michal(dot)kubski(at)cdt(dot)pl> writes:
> [ function that creates a bunch of temporary tables and immediately
> joins them ]

It'd probably be a good idea to insert an ANALYZE on the temp tables
after you fill them. The way you've got this set up, there is no chance
of auto-analyze correcting that oversight for you, so the planner will
be planning the join "blind" without any stats. Good results would only
come by pure luck.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Waldomiro 2009-10-26 19:56:12 Re: query planning different in plpgsql?
Previous Message Tom Lane 2009-10-26 17:31:01 Re: Full text search - query plan? PG 8.4.1