Database system that provides for history-enabled tables
First Claim
1. A computer-implemented method of creating and maintaining a history-enabled table in a relational database system, comprising:
- using at least one processor to perform a process, the process comprising;
identifying or creating a current row table by adding a start time column to a pre-existing table that comprises a current column in a relational database system and is to be history enabled;
identifying or creating a row history table in the relational database system that includes a period column and a history column corresponding to the current column in the current row table;
tracking history of the pre-existing table without reading an undo log;
responding to a change in a field in a current row of the current row table, the field being in the current column corresponding to the history column of the row history table, by at least;
creating or updating a history row of the row history table to include a data of the field prior to the change in the field, in whichthe row history table comprising a row period value that indicates a time period between a start time value of the current row of the current row table and a change time at which the change occurs; and
updating the start time value of the current row in the current row table to the change time at which the change occurs;
creating a history view that comprises a database view of a union of the current row table and the row history table, wherein the history view includes a period column, and a row period value in the period column is determined from the current row table and indicates a period of time that has not yet ended; and
performing a temporal query on the history view by using at least a temporal query function defined by the relational database management system, wherein the temporal query function comprises a function that takes a period of time as a parameter and returns a set of rows of the history view for which the period of time overlaps another period indicated by the row period value of one of the set of rows of the row history table.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques for history enabling a table in a database system so that past versions of rows of the history-enabled table are available for temporal querying. The table is history enabled by adding a start time column to the table and creating a history table for the history-enabled table. The start time field'"'"'s value in a row of the history-enabled table indicates when the contents of the row last changed. The rows of the history table are copies of rows of the history-enabled table that have been deleted or updated. The rows include end time fields whose values indicate when the row was updated or deleted. A history table'"'"'s row thus indicates a period in which the history table'"'"'s row was in the history-enabled table. Temporal queries are performed on a view which is the union of the history-enabled table and the history table.
90 Citations
35 Claims
-
1. A computer-implemented method of creating and maintaining a history-enabled table in a relational database system, comprising:
-
using at least one processor to perform a process, the process comprising; identifying or creating a current row table by adding a start time column to a pre-existing table that comprises a current column in a relational database system and is to be history enabled; identifying or creating a row history table in the relational database system that includes a period column and a history column corresponding to the current column in the current row table; tracking history of the pre-existing table without reading an undo log; responding to a change in a field in a current row of the current row table, the field being in the current column corresponding to the history column of the row history table, by at least; creating or updating a history row of the row history table to include a data of the field prior to the change in the field, in which the row history table comprising a row period value that indicates a time period between a start time value of the current row of the current row table and a change time at which the change occurs; and updating the start time value of the current row in the current row table to the change time at which the change occurs; creating a history view that comprises a database view of a union of the current row table and the row history table, wherein the history view includes a period column, and a row period value in the period column is determined from the current row table and indicates a period of time that has not yet ended; and performing a temporal query on the history view by using at least a temporal query function defined by the relational database management system, wherein the temporal query function comprises a function that takes a period of time as a parameter and returns a set of rows of the history view for which the period of time overlaps another period indicated by the row period value of one of the set of rows of the row history table. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)
-
-
13. An apparatus for creating and maintaining a history-enabled table in a relational database management system, the apparatus comprising:
-
at least one processor; a memory; a pre-existing table in the relational database system that is to be history-enabled; a history-enabled table creator that is to use the at least one processor to make a current row table by adding a start time column to the current row table comprising a column, corresponding to a current row in the pre-existing table, and to create a row history table that has a period column and a history row, the history row corresponding to the current row in the current row table, wherein the history-enabled table creator that is further to create a history view which comprises a database view of a union of the current row table and the row history table, and the history view is to include the period column, in which a row period value in the period column is determined from the current row table and indicates a period of time that has not yet ended; a history-enabled table maintainer that is to use the at least one processor to respond to a change in a field in the current row of the current row table and to track history of the pre-existing table without reading an undo log, in which the history-enabled table maintainer is to update or create the history row in the row history table to include a data of the field prior to the change in the field, the row history table is to comprise a row period value that indicates a time period between a start time value of the current row of the current row table and a change time at which the change occurs, and the history-enabled table maintainer is to update the start time value of the current row in the current row table to the change time at which the change occurs; and a query engine that is to perform a temporal query on the history view by using at least a temporal query function that is defined by the relational database management system, wherein the temporal query function comprises a function that takes a period of time as a parameter and returns a set of rows of the history view for which the period of time overlaps another period indicated by the row period value of one of the set of rows of the row history table. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21)
-
-
22. A computer-implemented method of creating and maintaining a history-enabled table in a relational database system, the method comprising:
-
using at least one processor to perform a process, the process comprising; identifying or creating a current row table by adding a start time column to a pre-existing table that comprises a current column in a relational database system and is to be history enabled; identifying or creating a row history table in the relational database system that has a period column and a history column corresponding to the current column in the current row table; tracking history of the pre-existing table without reading an undo log; responding to a change in a field in a row of the current row table, the field being in the current column corresponding to the history column of the row history table, by at least; creating or updating a history row of the row history table to include a data of the field prior to the change in the field, in which the row history table comprising a row period value that indicates a time period between a start time value of the current row of the current row table and a change time at which the change occurs; and updating the start time value of the current row in the current row table to the change time at which the change occurs; creating a history view that comprises a database view of a union of the current row table and the row history table, wherein the history view includes a period column, and a row period value in the period column is determined from the current row table and indicates a period of time that has not yet ended; and performing a temporal query on the history view by using at least a temporal query function defined by the relational database management system, wherein the temporal query function comprises a function that takes a period of time as a parameter and returns a set of rows of the history view for which the period of time overlaps another period indicated by the row period value of one of the set of rows of the row history table. - View Dependent Claims (23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34)
-
-
35. An apparatus for creating and maintaining a history-enabled table in a relational database management system, comprising:
-
at least one processor; a memory; a pre-existing table in the relational database system that is to be history-enabled; a history-enabled table creator that is to use the at least one processor to make a current row table by adding a start time column to the current row table comprising a column, corresponding to a current row in the pre-existing table, and to create a row history table that has a period column and a history row, the history row corresponding to the current row in the current row table, wherein the history-enabled table creator is further to create a history view that comprises a database view of a union of the current row table and the row history table, and the history view includes the period column, in which a row period value in the period column is determined from the current row table and indicates a period of time that has not yet ended; a history-enabled table maintainer that is to use the at least one processor to respond to a change in a field in the current row of the current row table and to track history of the pre-existing table without reading an undo log, wherein the history-enabled table maintainer is to update or create the history row in the row history table to include a data of the field prior to the change in the field, the row history table comprising a row period value that indicates a time period between a start time value of the current row of the current row table and a change time at which the change occurs, and the history-enabled table maintainer is to update the start time value of the current row in the current row table to the change time at which the change occurs; and a query engine that is to perform a temporal query on the history view by using at least a temporal query function that is defined by the relational database management system, wherein the temporal query function comprises a function that takes a period of time as a parameter and returns a set of rows of the history view for which the period of time overlaps another period indicated by the row period value of one of the set of rows of the row history table.
-
Specification