Re: Very slow DELETEs with foreign keys

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thom Brown <thom(at)linux(dot)com>
Cc: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Very slow DELETEs with foreign keys
Date: 2016-02-08 15:58:51
Message-ID: 4386.1454947131@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thom Brown <thom(at)linux(dot)com> writes:
> Yeah, there's no index on contacts.country, and that would certainly
> make the query acceptably quick, but I'm asking whether the
> non-indexed scenario is going about things the most efficient way,
> given what it has available to it.

[ shrug... ] If you're up for nuking the entire existing foreign-key
infrastructure and starting over, you could think about doing things
some other way. But you're not going to get to anyplace other than
"run a query for each deleted row" without a *lot* of work.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2016-02-08 16:05:01 Re: COALESCE requires NULL from scalar subquery has a type
Previous Message Nguyễn Trần Quốc Vinh 2016-02-08 15:32:56 Re: fast refresh materialized view