diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-20 22:00:54 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-03-20 22:00:54 +0000 |
commit | 354049c709c9d7d0918272e10e4f30d7f8f38788 (patch) | |
tree | 741c359a1e6494c3ef1b205b84603fd48239b015 /src/backend/commands/tablecmds.c | |
parent | 683f60da3d837236de5c4249fa2a62c8a94616ca (diff) | |
download | postgresql-354049c709c9d7d0918272e10e4f30d7f8f38788.tar.gz postgresql-354049c709c9d7d0918272e10e4f30d7f8f38788.zip |
Remove unnecessary calls of FlushRelationBuffers: there is no need
to write out data that we are about to tell the filesystem to drop.
smgr_internal_unlink already had a DropRelFileNodeBuffers call to
get rid of dead buffers without a write after it's no longer possible
to roll back the deleting transaction. Adding a similar call in
smgrtruncate simplifies callers and makes the overall division of
labor clearer. This patch removes the former behavior that VACUUM
would write all dirty buffers of a relation unconditionally.
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 819ac84e1e8..0b11976db84 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.147 2005/03/16 21:38:05 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.148 2005/03/20 22:00:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -5628,13 +5628,12 @@ copy_relation_data(Relation rel, SMgrRelation dst) Page page = (Page) buf; /* - * Since we copy the data directly without looking at the shared + * Since we copy the file directly without looking at the shared * buffers, we'd better first flush out any pages of the source - * relation that are in shared buffers. We assume no new pages will - * get loaded into buffers while we are holding exclusive lock on the - * rel. + * relation that are in shared buffers. We assume no new changes + * will be made while we are holding exclusive lock on the rel. */ - FlushRelationBuffers(rel, 0); + FlushRelationBuffers(rel); /* * We need to log the copied data in WAL iff WAL archiving is enabled |