Search Postgresql Archives

Re: Foreign Key ON DELETE CASCADE Performance

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

 



On Fri, Apr 30, 2004 at 09:35:39 -0700,
  Chris Gamache <cgg007@yahoo.com> wrote:
> 
> What can be done to increase the overall speed of this transaction, keeping the
> FKey Constraints in-place?

The fastest thing to do if you really want to get rid of everything is
do delete from for each of the tables starting with the ones that don't
have any tables dependent on them.

Another thing to note is that postgres doesn't automatically create
an index on columns that reference another table. When you are taking
advantage of cascading deletes you normally will want an index on such
columns. If you insist upon being able to do the delete using just a delete
from table1 you will want to create these indexes.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

[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