From: Andres Freund <andres@2ndquadrant.com>
To: pgsql-performance@postgresql.org
Cc: Daniel Farina <daniel@heroku.com>
Cc: Craig Ringer <ringerc@ringerc.id.au>
Cc: Stanislaw Pankevich <s.pankevich@gmail.com>
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: Fri, 6 Jul 2012 16:14:26 +0200
Message-ID: <201207061614.26739.andres@2ndquadrant.com> (raw)
In-Reply-To: <CAAZKuFbpYyfRA=+DKD4yCr_c_Tag2JNO32B8NVU15gg4xX3u_Q@mail.gmail.com>
References: <CAFXpGYbgmZYij4TgCbOF24-usoiDD0ASQeaVAkYtB7E2TYm8Wg@mail.gmail.com>
<4FF6CC11.2000904@ringerc.id.au>
<CAAZKuFbpYyfRA=+DKD4yCr_c_Tag2JNO32B8NVU15gg4xX3u_Q@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: andres@2ndquadrant.com, daniel@heroku.com, ringerc@ringerc.id.au, s.pankevich@gmail.com
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.
In-Reply-To: <201207061614.26739.andres@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox