Re: Delete Enhancement Request - Mailing list pgsql-admin

From Tom Lane
Subject Re: Delete Enhancement Request
Date
Msg-id 2613.1547516814@sss.pgh.pa.us
Whole thread Raw
In response to Re: Delete Enhancement Request  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-admin
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Jan 14, 2019 at 8:18 AM Campbell, Lance <lance@illinois.edu> wrote:
>> When deleting a large number of records with constraints and triggers PostgreSQL is exceptionally slow.

> You may wish to provide an explicit situation that you are
> experiencing so that others may offer their experienced insights as to
> whether you could be doing anything different to increase the speed of
> your deletes or techniques to batch them yourself.

Given the mention of constraints, I'm suspicious that the problem is
foreign key constraint(s) that lack an index on the referencing column(s).
PG will let you do that, but if you care about the speed of deletes on
the referenced table, you don't want to omit the index on the referencing
side.

            regards, tom lane


pgsql-admin by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Delete Enhancement Request
Next
From: Thomas Kellerer
Date:
Subject: Re: create tablespaces and users