Method and system for temporal aggregation
AssigneeTeradata US, Inc.
InventorsBhashyam Ramesh, Manjula Koppuravuri
Life of this patent
Estimating the term…
Abstract
A method, database system and computer program are disclosed for optimizing a SQL query, in which the SQL query seeks to aggregate temporal database information. The method includes determining whether two rows of information have a common grouping value, and if so, determining both temporal overlap and temporal non-overlap components of the two rows, aggregating each of the temporal overlap components of the two rows, and separating the temporal non-overlap components of the two rows.
Claims12
A computer-implemented method for aggregating information in a temporal database table that includes one or more time values defining a time period for information stored in the temporal database table, where the method includes:
- determining, by one more processor of a computer, whether two rows of information in a database table of the temporal database have a common grouping value, associated with the one or more particular time values defining the time period, for the aggregating of the information in the two rows of temporal database table stored by data elements of the two rows for the common grouping value, wherein each one of the two rows of information includes data for the same column of the database table and a particular time value defining a particular time period when the data is valid;
- and
- if so, determining, by the one more processor of the computer, both temporal overlap and temporal non-overlap components of the of the respective time periods of the two rows in the temporal database, aggregating each of the temporal overlap components of the of the respective time periods of the two rows at least by summing the data elements in the two rows, and
- separating, by the one more processor of the computer, the temporal non-overlap components of the respective time periods of the two rows, wherein the temporal non-overlap components of the two rows and the temporal overlap components of the two rows are stored in separate rows at least temporarily in a temporary table to facilitate the aggregating on the information;
- and
- iterating by the one more processor of the computer the method steps for all the rows in the temporal database table;
- and
- when all rows of the database table have been read, reviewing the contents of the temporary table to coalesce the temporary table entries by a common grouping value and a common period of validity.
Dependencies are inferred from the claim text.