Enforcement of referential constraints in a database system
First Claim
1. A method for generating an access plan for a relational database, having a plurality of database objects, from a plurality of database access commands used to access the database objects, said method comprising the steps performed by a computer system of:
- compiling the plurality of database access commands into a first executable code set for inclusion in the access plan;
during said compiling step, determining constraint relationships among selected database objects utilized during execution of the plurality of database access commands;
also during said compiling step, generating a plurality of second executable code sets to enforce the determined constraint relationships; and
also during said compiling step, merging the first executable code set and the plurality of second executable code sets to form an access plan having both code for executing the database access commands and code for enforcing the determined constraint relationships within the access plan.
0 Assignments
0 Petitions
Accused Products
Abstract
A system and method for enforcing referential integrity within a database system provides for determination of relevant referential constraints at compile time for an access plan. All referential constraints which are relevant to data changes to the database are identified when the access plan is created. Code necessary for performing referential constraint checks is inserted directly into the access plan at compile time, eliminating the necessity for determining the relevant constraints at run time. Constraint checking can be performed using substantially the same low-level procedural statements already used in the access plan for performing database accesses.
-
Citations
10 Claims
-
1. A method for generating an access plan for a relational database, having a plurality of database objects, from a plurality of database access commands used to access the database objects, said method comprising the steps performed by a computer system of:
-
compiling the plurality of database access commands into a first executable code set for inclusion in the access plan; during said compiling step, determining constraint relationships among selected database objects utilized during execution of the plurality of database access commands; also during said compiling step, generating a plurality of second executable code sets to enforce the determined constraint relationships; and also during said compiling step, merging the first executable code set and the plurality of second executable code sets to form an access plan having both code for executing the database access commands and code for enforcing the determined constraint relationships within the access plan. - View Dependent Claims (2)
-
-
3. A computer system for generating an access plan for a relational database having a plurality of database objects from a plurality of database access commands used to access the database objects, said computer system comprising:
-
means for compiling the plurality of database access commands into a first executable code set for inclusion in the access plan; means for, during compilation of the database access commands, determining constraint relationships among selected database objects utilized during execution of the plurality of database access commands; means for, during compilation of the database access commands, generating a plurality of second executable code sets for enforcing the determined constraint relationships; and
,means for, during compilation of the database access commands, merging the first executable code set and the plurality of second executable code sets to form an access plan having both code for executing the database access commands and code for enforcing the determined constraint relationships within the access plan. - View Dependent Claims (4, 5, 6)
-
-
7. A method for performing database operations on data tables in a database system, comprising the steps performed by a computer system of:
-
providing a plurality of access plans, each corresponding to a selected group of database operations and containing compiled code for accessing tables in the database, each access plan further containing code for performing constraint checking during table access and preventing execution of database operations which would not be consistent with referential integrity of the database; performing a database access by executing the compiled accessing code in a corresponding access plan; and during said step of performing a database access, maintaining the referential integrity of the database by executing the constraint checking code contained in such corresponding access plan. - View Dependent Claims (8, 9, 10)
-
Specification