Re: Extremely slow DELETE with cascade foreign keys

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

 



Rodrigo Rosenfeld Rosas <rr.rosas@xxxxxxxxx> writes:
> Hi, I think something changed recently in my development environment as 
> I don't recall deletes being so slow before.
> I've created a new dump and restored to a new database, ran VACUUM FULL 
> ANALYSE and a simple delete takes forever as you can see here:

The usual suspect for this is not having an index on some FK referencing
column, thus forcing the FK check trigger to seq-scan the entire
referencing table for each referenced row that is to be deleted.

			regards, tom lane




[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux