Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group