Re: Statistics with temporary tables, optimizer question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Kupershmidt <schmiddy(at)gmail(dot)com>
Cc: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Statistics with temporary tables, optimizer question
Date: 2010-09-23 14:36:59
Message-ID: 14846.1285252619@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Josh Kupershmidt <schmiddy(at)gmail(dot)com> writes:
> On Thu, Sep 23, 2010 at 9:33 AM, Mladen Gogala
> <mladen(dot)gogala(at)vmsinfo(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message kevin burdish 2010-09-23 15:45:27 ERROR: invalid input syntax for integer: ""
Previous Message Josh Kupershmidt 2010-09-23 14:26:28 Re: Statistics with temporary tables, optimizer question