Re: AutoVacuum Behaviour Question

From: Bruce McAlister <bruce(dot)mcalister(at)blueface(dot)ie>
To: Alban Hertroys <alban(at)magproductions(dot)nl>
Subject: Re: AutoVacuum Behaviour Question
Date: 2007-06-28 10:12:19
Message-ID: 46838983.4050207@blueface.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Alban Hertroys wrote:
> Bruce McAlister wrote:
>> Which brings me onto a possibly related question. I've noticed that in
>> this particular database, that there are temporary tables that are
>> created. I'm not 100% sure how/why these temporary tables are being
>> created, but I do assume that it must be by some sort of SQL query that
>> runs against the database. How does postgresql handle these temporary
>> tables, i mean, if a temporary table is created by some sql query, is it
>> up to the user performing the query to remove the temporary table
>> afterwards, or does postgresql automagically remove the temporary table
>> when the query completes?
>
> That would defeat the purpose of temporary tables. You usually create
> them to perform queries on a data set from another query from the same
> session.
>

I just want to verify that I understand you correctly here, do you mean
that the temporary table is created by specific sql, for example, create
temp table, then perform some actions on that temp table, then, either
you remove the temp table, or, if you close the session/connection the
postmaster will clean up the temp table? What happens if you're using
connection pools, i mean are those sessions deemed "closed" after the
queries complete, when the pool connections are persistent.

Excuse my PGSQL ignorance, I'm new to PostgreSQL, and waiting for these
PGSQL books to become available:

http://www.network-theory.co.uk/newtitles.html

So at the moment I'm working on principles of databases as apposed to
actual intimate knowledge of PGSQL itself.

> AFAIK temporary tables are dropped when the session in which they were
> created terminates, or optionally on commit if specified that way (ON
> COMMIT DROP).
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshi, Yateen 2007-06-28 10:28:43 Re: Why does postgres take time to shut down sometimes?
Previous Message Richard Huxton 2007-06-28 10:00:40 Re: Execution variability

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2007-06-28 10:40:45 Re: AutoVacuum Behaviour Question
Previous Message Alban Hertroys 2007-06-28 09:46:31 Re: AutoVacuum Behaviour Question