Method for providing a system maintained materialized functionally dependent column for a database management system
AssigneeInternational Business Machines Corporation
InventorsTing Yu Leung, Serge P. Rielau
Life of this patent
Estimating the term…
Abstract
A mechanism for supporting generated materialized columns without explicitly adding triggers and a check constraint in a database management system (DBMS). When a column affecting the generated materialized column is updated, a “before-update” trigger is internally generated in the DBMS and added as the last trigger before the update occurs. Similarly, when an insert operation is performed, a “before-insert” trigger is generated internally by the DBMS and added as the last trigger before the insert operation occurs. Since the triggers are generated internally in the DBMS, a constraint is not needed for either the update or the insert operations.
Claims12
A method for maintaining a materialized generated column in a database management system, said method, comprising the steps of:
- (a) generating an internal object in response to one of a plurality of rows in a table of a database being modified, the table including a materialized generated column, the materialized generated column being dependent on one or more dependent columns, wherein said row includes one or more of the dependent columns;
- and
- (b) executing said generated internal object in a preprocessing module of the database management system after all preprocessing operations for manipulating columns upon which said generated internal object depends have been performed.
A computer program product for use on a computer for maintaining a materialized generated column in a database management system, said computer program product comprising:
- a recording medium;
- means recorded on said recording medium for instructing a processing unit to perform the steps of,
- (a) generating an internal object in response to one of a plurality of rows in a table of a database being modified, the table including a materialized generated column, the materialized generated column being dependent on one or more dependent columns, wherein said row includes one or more of the dependent columns;
- (b) if the modification to said row comprises an update operation, said generated internal object is included in a before-trigger list as a before-trigger, and said generated internal object being added as the last before-trigger to the before-trigger list;
- and
- (c) processing said before-trigger before said row is modified.
A computer program product for use on a computer for maintaining a materialized generated column in a database system, said computer program product comprising:
- a recording medium;
- means recorded on said medium for instructing a processing unit to perform the steps of,
- generating an internal object in response to one of a plurality of the rows in a table of a database being modified, the table including a materialized generated column, the materialized generated column being dependent on one or more dependent columns, wherein said row includes one or more of the dependent columns;
- and
- executing said generated internal object in a preprocessing module after all preprocessing operations for manipulating said columns upon which said generated internal object depends have been performed.
Dependencies are inferred from the claim text.