Managing a temporal key property in a database management system
AssigneeInternational Business Machines Corporation
InventorsBalakrishna R. IYER, Robert W. LYLE, Jerry MUKAI
Life of this patent
Estimating the term…
Abstract
Embodiments provide an approach for efficiently searching a temporal key index as well as enforcing key distinctiveness property in a database table corresponding to the index. For example, by addressing time range overlaps in an index having a sort order for temporal keys, a database management tool of a server system may efficiently process client requests while enforcing a temporal key property in the database table.
Claims15
A computer-implemented method for enforcing a temporal key property in a database table, the method comprising:
- receiving a request to perform a group update of one or more database rows in the table, wherein each requested update includes a temporal key and an associated start time and end time;
- accessing, by operation of one or more computer processors, an index corresponding to temporal keys in the table, wherein each entry in the index includes one of the temporal keys and an associated start time and end time;
- for each requested update:
- deleting the database row to be updated,
- upon determining that the index does not include an entry having the temporal key of the update, adding an entry to the index that corresponds to the update and inserting a database row into the table that corresponds to the update, and
- upon determining that the index includes an entry having the temporal key of the update:
- upon determining that no overlap exists between the update and an index entry, adding an entry to the index that corresponds to the update and inserting a database row into the table that corresponds to the update;
- and
- upon determining that an overlap exists between the update and an index entry, storing a pointer to the update in an overlap data structure.
A computer-readable storage medium storing an application, which, when executed, performs an operation for enforcing a temporal key property in a database table, the operation comprising:
- receiving a request to perform a group update of one or more database rows in the table, wherein each requested update includes a temporal key and an associated start time and end time;
- accessing, by operation of one or more computer processors, an index corresponding to temporal keys in the table, wherein each entry in the index includes one of the temporal keys and an associated start time and end time;
- for each requested update:
- deleting the database row to be updated,
- upon determining that the index does not include an entry having the temporal key of the update, adding an entry to the index that corresponds to the update and inserting a database row into the table that corresponds to the update, and
- upon determining that the index includes an entry having the temporal key of the update:
- upon determining that no overlap exists between the update and an index entry, adding an entry to the index that corresponds to the update and inserting a database row into the table that corresponds to the update;
- and
- upon determining that an overlap exists between the update and an index entry, storing a pointer to the update in an overlap data structure.
A system comprising:
- a processor;
- and
- a memory storing an application program, which, when executed on the processor, performs an operation for enforcing a temporal key property in a database table, the operation comprising:
- receiving a request to perform a group update of one or more database rows in the table, wherein each requested update includes a temporal key and an associated start time and end time,
- accessing, by operation of one or more computer processors, an index corresponding to temporal keys in the table, wherein each entry in the index includes one of the temporal keys and an associated start time and end time;
- for each requested update:
- deleting the database row to be updated;
- upon determining that the index does not include an entry having the temporal key of the update, adding an entry to the index that corresponds to the update and inserting a database row into the table that corresponds to the update;
- and
- upon determining that the index includes an entry having the temporal key of the update:
- upon determining that no overlap exists between the update and an index entry, adding an entry to the index that corresponds to the update and inserting a database row into the table that corresponds to the update, and
- upon determining that an overlap exists between the update and an index entry, storing a pointer to the update in an overlap data structure
Dependencies are inferred from the claim text.