A method for compiling efficient constraint checks in database programming languages (semantic integrity constraints)

Ralph E. Bunker · 1986

A three stage method that uses semantic integrity constraints to build efficient constraint checks for arbitrarily complex transactions is presented. A transaction is viewed as a set of paths. The first stage creates a compile-time description of the pre-updated and updated databases for each path. The second stage uses these descriptions to evaluate the semantic integrity constraints, at compile-time. Both the prefix and the matrix of a constraint are analyzed at this time. Constraint checks are created when a constraint cannot be completely evaluated. The third stage decides whether a constraint check should be a precondition or a postcondition of the transaction. The advantages of this method are: (1) It applies to any transaction language. In particular, the language may have loops and other control statements. (2) It is fast. Instead of a general purpose theorem prover, rapidly accessed rules are used to evaluate the constraints at compile-time. The rules are sound but not complete. A prototype implementation indicates a speed up of 50 over a theorem prover based method. (3) It builds constraint checks whose structure reveals why the check is needed. This helps the transaction designer understand why certain semantic integrity constraints are jeopardized by the transaction and may help to reveal design flaws in the transaction. (4) It is relatively easy to extend the method to incorporate new rules for the compile-time evaluation of constraints.

Read the paper · More papers on PaperTik