Search Postgresql Archives

Re: deleting rows with foreign keys

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

 



Tom Allison <tom@xxxxxxxxxxx> writes:
> I have ~250K rows in this table.
> the token_idx is referenced in two other tables, both of whom have a  
> foreign key constraint to ON DELETE CASCADE.
> Of the other two tables, one has ~1M rows and the other ~350K rows.   

> Problem:
> Deleting one row can take 2 seconds.

> Is there something I can do to improve the speed.

Put indexes on the referencing columns.  Without that, a seqscan is
required to look for referencing rows.

			regards, tom lane


[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