Re: [GENERAL] Slow delete when many foreign tables are defined

2014-12-01 Thread Bill Moran
On Mon, 01 Dec 2014 11:00:51 -0600 Andy Colson wrote: > On 12/1/2014 10:21 AM, Giuseppe Sacco wrote: > > Il giorno lun, 01/12/2014 alle 09.49 -0600, Andy Colson ha scritto: > >> On 12/1/2014 9:23 AM, Giuseppe Sacco wrote: > >>> Hello, > >>> I have a main table and a lot of "details" tables that r

Re: [GENERAL] Slow delete when many foreign tables are defined

2014-12-01 Thread Andy Colson
On 12/1/2014 10:37 AM, Alban Hertroys wrote: On 1 December 2014 at 17:21, Giuseppe Sacco wrote: Il giorno lun, 01/12/2014 alle 09.49 -0600, Andy Colson ha scritto: On 12/1/2014 9:23 AM, Giuseppe Sacco wrote: 2) Try inheritance. I have no idea if it'll help, but I thought I'd read someplace

Re: [GENERAL] Slow delete when many foreign tables are defined

2014-12-01 Thread Andy Colson
On 12/1/2014 10:21 AM, Giuseppe Sacco wrote: Il giorno lun, 01/12/2014 alle 09.49 -0600, Andy Colson ha scritto: On 12/1/2014 9:23 AM, Giuseppe Sacco wrote: Hello, I have a main table and a lot of "details" tables that reference the main one. Every time I delete a record from the main table, a

Re: [GENERAL] Slow delete when many foreign tables are defined

2014-12-01 Thread Alban Hertroys
On 1 December 2014 at 17:21, Giuseppe Sacco wrote: > Il giorno lun, 01/12/2014 alle 09.49 -0600, Andy Colson ha scritto: >> On 12/1/2014 9:23 AM, Giuseppe Sacco wrote: >> 2) Try inheritance. I have no idea if it'll help, but I thought I'd >> read someplace where the planner knew a little more ab

Re: [GENERAL] Slow delete when many foreign tables are defined

2014-12-01 Thread Giuseppe Sacco
Il giorno lun, 01/12/2014 alle 09.49 -0600, Andy Colson ha scritto: > On 12/1/2014 9:23 AM, Giuseppe Sacco wrote: > > Hello, > > I have a main table and a lot of "details" tables that reference the > > main one. > > > > Every time I delete a record from the main table, a check is done on > > every

Re: [GENERAL] Slow delete when many foreign tables are defined

2014-12-01 Thread Andy Colson
On 12/1/2014 9:23 AM, Giuseppe Sacco wrote: Hello, I have a main table and a lot of "details" tables that reference the main one. Every time I delete a record from the main table, a check is done on every details table that contain a foreign key toward main table. This is a simplified schema:

[GENERAL] Slow delete when many foreign tables are defined

2014-12-01 Thread Giuseppe Sacco
Hello, I have a main table and a lot of "details" tables that reference the main one. Every time I delete a record from the main table, a check is done on every details table that contain a foreign key toward main table. This is a simplified schema: create table main ( type varchar, serial numer