0

For example, if I set ON DELETE CASCADE, can it somehow affect performance outside delete command? Or will it only affect performance when deleting?

And more importantly - if I set to do nothing on delete (eg no delete constraint), will postgres do any special validations when selecting from that table that could impact performance, or am I only risking getting corrupted data?

Thanks!

1 Answer 1

0

It definitely won't affect SELECT.

It can affect UPDATE and DELETE on the parent (referenced) table, and INSERT and UPDATE on the referencing side.

DO NOTHING doesn't mean "ignore this constraint". It's enforced. See the manual. The spelling is SQL-standard weirdness.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .