pgsql: Make TRUNCATE do truncate-in-place when processing a relation

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Make TRUNCATE do truncate-in-place when processing a relation
Date: 2009-08-23 19:23:41
Message-ID: 20090823192341.368B075331E@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Make TRUNCATE do truncate-in-place when processing a relation that was created
or previously truncated in the current (sub)transaction. This is safe since
if the (sub)transaction later rolls back, we'd just discard the rel's current
physical file anyway. This avoids unreasonable growth in the number of
transient files when a relation is repeatedly truncated. Per a performance
gripe a couple weeks ago from Todd Cook.

Modified Files:
--------------
pgsql/src/backend/catalog:
heap.c (r1.357 -> r1.358)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/heap.c?r1=1.357&r2=1.358)
pgsql/src/backend/commands:
tablecmds.c (r1.297 -> r1.298)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c?r1=1.297&r2=1.298)
pgsql/src/include/catalog:
heap.h (r1.91 -> r1.92)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/heap.h?r1=1.91&r2=1.92)

Browse pgsql-committers by date

  From Date Subject
Next Message User Fxjr 2009-08-24 00:55:42 npgsql - Npgsql2: [#1010668] Npgsql ConnectionStringBuilder provides no
Previous Message Tom Lane 2009-08-23 18:26:15 pgsql: Tweak ExecIndexEvalRuntimeKeys to forcibly detoast any toasted