Re: Strange delete behaviour - Mailing list pgsql-general

From Tom Lane
Subject Re: Strange delete behaviour
Date
Msg-id 2564.1122905622@sss.pgh.pa.us
Whole thread Raw
In response to Re: Strange delete behaviour  ("Renzo Kottmann" <renzo@tzi.de>)
List pgsql-general
"Renzo Kottmann" <renzo@tzi.de> writes:
>     "t_annotation_ann_startnode_id_fkey" FOREIGN KEY (ann_startnode_id)
> REFERENCES t_node(node_global_id) MATCH FULL
>     "t_annotation_ann_endnode_id_fkey" FOREIGN KEY (ann_endnode_id)
> REFERENCES t_node(node_global_id) MATCH FULL

You need indexes on ann_startnode_id and ann_endnode_id.  There might be
some other missing indexes too --- check each of your foreign key
constraints.

Postgres doesn't force you to keep an index on the referencing side of a
foreign key ... but if you want deletes from the master table to be
fast, you'd better have one.

            regards, tom lane

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Strange delete behaviour
Next
From: Peter Fein
Date:
Subject: Schema Pivileges was Re: Alter privileges for all tables