OSDN Git Service

Make TRUNCATE do truncate-in-place when processing a relation that was created
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 23 Aug 2009 19:23:41 +0000 (19:23 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 23 Aug 2009 19:23:41 +0000 (19:23 +0000)
commitcab9a0656c36739f59277b34fea8ab9438395869
tree80250331addd74178dca2959ff598570c3545585
parentc38b75947e015afdd2a18d099f52d29748734e32
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.
src/backend/catalog/heap.c
src/backend/commands/tablecmds.c
src/include/catalog/heap.h