pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andy Colson <andy@squeakycode.net>
To: sthomas@peak6.com
Cc: Greg Spiegelberg <gspiegelberg@gmail.com>
Cc: Reuven M. Lerner <reuven@lerner.co.il>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Marcin Mańk <marcin.mank@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Very long deletion time on a 200 GB database
Date: Thu, 23 Feb 2012 12:11:12 -0600
Message-ID: <4F468140.2090704@squeakycode.net> (raw)
In-Reply-To: <4F467FCD.8090100@peak6.com>
References: <4F45FB55.1020600@lerner.co.il>
	<CAK61fk6bSQtmDUzm2rNv33kN4Oar_dYZ-yFEa9zR_zLL8L9esQ@mail.gmail.com>
	<4F464C49.4050503@dunslane.net>
	<4F465A7A.4000905@lerner.co.il>
	<CAEtnbpUZkdg-gH_AcbTMG41yN+Y0ECXdtnGTdf232B6T3v_1SA@mail.gmail.com>
	<4F467FCD.8090100@peak6.com>

On 2/23/2012 12:05 PM, Shaun Thomas wrote:
> On 02/23/2012 11:56 AM, Greg Spiegelberg wrote:
>
>> I know there are perils in using ctid but with the LOCK it should be
>> safe. This transaction took perhaps 30 minutes and removed 100k rows
>> and once the table was VACUUM'd afterward it freed up close to 20 GB
>> on the file system.
>
> It took *30 minutes* to delete 100k rows? And 100k rows were using 20GB?
> Is that off by an order of magnitude?
>
> Using the ctid is a cute trick, though. :)
>

And I'm not sure the LOCK is necessary, while googling for "delete from 
table limit 10" I ran across this thread:

http://archives.postgresql.org/pgsql-hackers/2010-11/msg02028.php

They use it without locks.

-Andy



view thread (42+ messages)  latest in thread

Message-ID: <4F468140.2090704@squeakycode.net>
Permalink:  ../4F468140.2090704@squeakycode.net/
Also on:    postgresql.org/message-id/4F468140.2090704@squeakycode.net

 · 

reply

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: andy@squeakycode.net, sthomas@peak6.com, gspiegelberg@gmail.com, reuven@lerner.co.il, andrew@dunslane.net, marcin.mank@gmail.com
  Subject: Re: Very long deletion time on a 200 GB database
  In-Reply-To: <4F468140.2090704@squeakycode.net>

* 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