Re: Best way to delete big amount of records from big table

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Ekaterina Amez <ekaterina(dot)amez(at)zunibal(dot)com>
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Best way to delete big amount of records from big table
Date: 2020-03-28 04:32:57
Message-ID: ec48ca143f128cbd2b8202338c3122f3c01078b6.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Fri, 2020-03-27 at 16:15 +0100, Ekaterina Amez wrote:
> > You should define primary and foreign keys if you can, but I guess
> > I don't have to tell you that.
>
> Excuse me if this is a silly question but I've read (or understood) that it's better
> to remove constraints to improve delete performance... this is related to indexes only? or also to PK-FK?

I meant, add constraints *after* you are done cleaning up.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Silvio Moioli 2020-03-30 06:47:05 Increasing work_mem slows down query, why?
Previous Message daya airody 2020-03-27 15:24:54 Re: JOIN on partitions is very slow