Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones. - Mailing list pgsql-performance

From Andres Freund
Subject Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones.
Date
Msg-id 201207061614.26739.andres@2ndquadrant.com
Whole thread Raw
In response to Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones.  (Daniel Farina <daniel@heroku.com>)
List pgsql-performance
On Friday, July 06, 2012 01:38:56 PM Daniel Farina wrote:
> ll, I don't know a
> mechanism besides slow file system truncation time that would explain
> why DELETE would be significantly faster.
There is no filesystem truncation happening. The heap and the indexes get
mapped into a new file. Otherwise rollback would be pretty hard to implement.

I guess the biggest cost in a bigger cluster is the dropping the buffers that
were formerly mapped to that relation (DropRelFileNodeBuffers).

Andres
--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-performance by date:

Previous
From: Misa Simic
Date:
Subject: Re: Paged Query
Next
From: Craig Ringer
Date:
Subject: Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones.