Re: [GENERAL] Very slow DELETEs with foreign keys

2016-02-08 Thread Tom Lane
Thom Brown 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 t

Re: [GENERAL] Very slow DELETEs with foreign keys

2016-02-08 Thread Thom Brown
On 8 February 2016 at 14:52, Tom Lane wrote: > Thom Brown writes: >> I've just noticed a general delete performance issue while testing a >> patch, and this can be recreated on all recent major versions. > >> I have 2 tables: > >> CREATE TABLE countries ( >> country text PRIMARY KEY, >> c

Re: [GENERAL] Very slow DELETEs with foreign keys

2016-02-08 Thread Tom Lane
Thom Brown writes: > I've just noticed a general delete performance issue while testing a > patch, and this can be recreated on all recent major versions. > I have 2 tables: > CREATE TABLE countries ( > country text PRIMARY KEY, > continent text > ); > CREATE TABLE contacts ( > id s