When should I create a Constraint like DEFERRED?

Asked

Viewed 75 times

4

As far as I know, creating a Constraint (like a foreign key or a check) like DEFERRED makes it only validated at the end of the transaction.

What is this used for? And when it should not be used?

1 answer

0

A good practice with DEFERRED finds application in the movement of large volumes of data. When the validation of the Constraint occurs only in COMMIT, usually the Chunk (very large volumes should be divided into Chunks) is recorded faster.

Another possible use would be a key drive. In such cases, it is not possible to change primary or foreign keys without postponing or disabling the constraints.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.