Re: Why copy_relation_data only use wal whenWALarchivingis enabled

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Jacky Leng <lengjianquan(at)163(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why copy_relation_data only use wal whenWALarchivingis enabled
Date: 2007-10-18 14:15:00
Message-ID: 47176A64.60108@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Heikki Linnakangas <heikki(at)enterprisedb(dot)com> writes:
>> The best I can think of is to rename the obsolete file to
>> <relfilenode>.stale, when it's scheduled for deletion at next
>> checkpoint, and check for .stale-suffixed files in GetNewRelFileNode,
>> and delete them immediately in DropTableSpace.
>
> This is getting too Rube Goldbergian for my tastes. What if we just
> make DROP TABLESPACE force a checkpoint before proceeding?

True, that would work. DROP TABLESPACE should be uncommon enough that
the performance hit is ok. We only need to checkpoint if the directory
isn't empty, though I think that's the case more often than not; you're
most likely to drop a tablespace right after dropping all relations in it.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian G. Pflug 2007-10-18 14:18:21 Re: Why copy_relation_data only use wal whenWALarchivingis enabled
Previous Message Pavel Stehule 2007-10-18 14:09:36 Re: Proposal: generate_iterator functions

Browse pgsql-patches by date

  From Date Subject
Next Message Florian G. Pflug 2007-10-18 14:18:21 Re: Why copy_relation_data only use wal whenWALarchivingis enabled
Previous Message Tom Lane 2007-10-18 13:52:23 Re: Why copy_relation_data only use wal whenWALarchivingis enabled