Thanks to visit codestin.com
Credit goes to postgrespro.com

Re: optimizing CleanupTempFiles - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: optimizing CleanupTempFiles
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: optimizing CleanupTempFiles  (Tom Lane <[email protected]>)
Responses Re: optimizing CleanupTempFiles
Re: optimizing CleanupTempFiles
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <[email protected]> writes:
>> BTW in testing this patch I was surprised by the fact that temp tables
>> files are removed at checkpoint time,
> 
> [ blink... ]  Doesn't look like that should happen.  What is your
> test case?

Hmph, must be because of the patch from last winter to prevent 
relfilenode reuse until next checkpoint. Looks like we didn't make an 
exception for temporary tables. Although it's harmless, we could put an 
isTempOrToastNamespace() test in there:

*** md.c    11 Aug 2008 11:05:11 -0000    1.139
--- md.c    18 Sep 2008 06:22:13 -0000
***************
*** 19,24 ****
--- 19,25 ----  #include <sys/file.h>
  #include "catalog/catalog.h"
+ #include "catalog/namespace.h"  #include "miscadmin.h"  #include "postmaster/bgwriter.h"  #include "storage/fd.h"
***************
*** 324,330 ****      /*       * Delete or truncate the first segment.       */
!     if (isRedo || forkNum != MAIN_FORKNUM)          ret = unlink(path);      else      {
--- 325,331 ----      /*       * Delete or truncate the first segment.       */
!     if (isRedo || forkNum != MAIN_FORKNUM || 
isTempOrToastNamespace(rnode.spcNode))          ret = unlink(path);      else      {

--   Heikki Linnakangas  EnterpriseDB   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 0x1A in control file on Windows
Next
From: ITAGAKI Takahiro
Date:
Subject: Re: 0x1A in control file on Windows