Re: Deleting millions of rows

From: David Wilson <david(dot)t(dot)wilson(at)gmail(dot)com>
To: Brian Cox <brian(dot)cox(at)ca(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Deleting millions of rows
Date: 2009-02-02 20:57:25
Message-ID: e7f9235d0902021257s6d12d315kde27976578dee48d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Feb 2, 2009 at 3:37 PM, Brian Cox <brian(dot)cox(at)ca(dot)com> wrote:
> David Wilson [david(dot)t(dot)wilson(at)gmail(dot)com] wrote:
>
>> Is this table the target of any foreign keys?
>
> There are 2 "on delete cascade" FKs that reference this table.

I believe that's the source of your memory issues. I think TRUNCATE
may handle this more effectively; alternately you can handle the
cascading yourself in these cases. (And, as Dave Dutcher mentioned,
TRUNCATE is definitely the way to go for full-table wipes).

--
- David T. Wilson
david(dot)t(dot)wilson(at)gmail(dot)com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2009-02-02 20:58:35 Re: Deleting millions of rows
Previous Message Brian Cox 2009-02-02 20:37:04 Re: Deleting millions of rows