Re: Unbearably slow cascading deletes - Mailing list pgsql-performance

From Christopher Kings-Lynne
Subject Re: Unbearably slow cascading deletes
Date
Msg-id 40FDC8F0.30102@familyhealth.com.au
Whole thread Raw
In response to Unbearably slow cascading deletes  (andrew@pillette.com)
List pgsql-performance
> I have (among other things) a parent table with 200 records and a child table with 20MM or more. I set up referential
integrityon the FK with ON DELETE CASCADE. 
>
> It appears that when a DELETE is done on the parent table, the child table deletion is done with a sequential scan. I
saythis because it took over four minutes to delete a parent record THAT HAD NO CHILDREN. The DB is recently analyzed
andSELECTs in the child table are done by the appropriate index on the FK. 

Do you have an index on the foreign key field?

Chris


pgsql-performance by date:

Previous
From: andrew@pillette.com
Date:
Subject: Re: Unbearably slow cascading deletes
Next
From: Rod Taylor
Date:
Subject: Re: Odd sorting behaviour