Re: optimizing CleanupTempFiles - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: optimizing CleanupTempFiles
Date
Msg-id 20080918150654.GA3868@alvh.no-ip.org
Whole thread Raw
In response to Re: optimizing CleanupTempFiles  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: optimizing CleanupTempFiles  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> > Tom Lane wrote:
> >> [ blink... ]  Doesn't look like that should happen.  What is your
> >> test case?

This was simply a CREATE TEMP TABLE ... ON COMMIT DROP.  The file stays
in place until checkpoint (either a manually invoked one, or a
shutdown's)

Don't temp tables use this kind of temp file?  I admit I didn't check; I
just assumed they did.

> > Hmph, must be because of the patch from last winter to prevent 
> > relfilenode reuse until next checkpoint.
> 
> Ah.  I had misunderstood Alvaro to say that temp files (the kind under
> discussion up to now) were not unlinked immediately; which would be
> pretty strange given that fd.c is underneath md.c.

The test case where I actually verify that fd.c was used was a WITH
SCROLL cursor.  The file does go away like I expected in that case, as
soon as the cursor is destroyed (or as soon as the backend is closed).

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Subtransaction commits and Hot Standby
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: Do we really need a 7.4.22 release now?