Search Postgresql Archives

Re: Extremely Slow Cascade Delete Operation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 13/01/2010 4:09 PM, Yan Cheng Cheok wrote:
I have 3 tables - lot, unit and measurement

1 lot is having relationship to many unit.
1 unit is having relationship to many measurement.
delete cascade is being used among their relationship


SemiconductorInspection=# delete from lot where lot_id = 2;

Are there indexes on fk_lot_id and fk_unit_id ? If not, a DELETE from lot will cause a seqscan of unit for affected units, and if any must be deleted each will cause a seqscan of measurement for affected measurements. That's going to get ugly fast.

--
Craig Ringer

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux