Josh Kupershmidt <schmiddy@gmail.com> writes:
> On Thu, Sep 23, 2010 at 9:33 AM, Mladen Gogala
> <mladen.gogala@vmsinfo.com> wrote:
>> My question is how does the optimizer calculate stats for the temporary
>> tables? I am probably not expected to do a vacuum analyze on the
>> temporary table, after finishing the inserts? How exactly does the optimizer
>> deal
>> with the temporary tables?
> The advice I've seen says to manually run an ANALYZE on a temporary
> table which you're going to be doing something performance-intensive
> with.
Yeah. Autovacuum cannot help you with a temp table --- it can't
safely access such a table. So the stuff that normally goes on
"in the background" has to be done explicitly if you need it done.
regards, tom lane