Re: Delete Enhancement Request

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "Campbell, Lance" <lance(at)illinois(dot)edu>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Delete Enhancement Request
Date: 2019-01-15 01:46:54
Message-ID: 2613.1547516814@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> On Mon, Jan 14, 2019 at 8:18 AM Campbell, Lance <lance(at)illinois(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Thomas Kellerer 2019-01-15 07:26:25 Re: create tablespaces and users
Previous Message David G. Johnston 2019-01-15 01:41:35 Re: Delete Enhancement Request