Method and apparatus for producing sequenced queries
AssigneeAmazon.com, Inc.
InventorsJohn Bair, Richard T Snodgrass
Life of this patent
Estimating the term…
Abstract
A method and apparatus converts an original query into a sequenced query that takes into account a range of values of a variable defined by a start and end point in performing the query. The start or end points are calculated if necessary and a query to collect all of the start and end points may be generated, and a query is generated that produces a constant set of start and end points defining consecutive periods, such that all the data in the tables related to the original query is constant over each of these periods. These two queries are merged into the original query to produce a sequenced query capable of execution on various database software and capable of taking into account the range of values of the variable in performing the original query.
Claims34
A method in a computer system for, from a dataset of one or more dependent variables expressed relative to a time variable, evaluating a function of the dependent variables in terms of the time variable, comprising:
- within a range of values of the time variable, identifying subranges of the time variable for which the value of each dependent variable is constant;
- and
- evaluating the function from values of the dependent variables exactly once for each identified subrange of the time variable, wherein the dataset is stored in one or more database tables, and wherein the identifying and evaluating includes performing at least one query on the database tables.
A method in a computer system for, from a dataset of one or more dependent variables expressed relative to an independent variable, evaluating a function of the dependent variables in terms of the independent variable, comprising:
- within a range of values of the independent variable, identifing subranges of the independent variable for which the value of each dependent variable is constant;
- and
- evaluating the function from values of the dependent variables exactly once for each identified subrange of the independent variable, wherein the dataset is stored in one or more database tables, and wherein the identifying and evaluating includes performing at least one query on the database tables.
A computer-readable medium whose contents cause a computer system to, from a dataset of one or more dependent variables expressed relative to an independent variable, evaluate a function of the dependent variables in terms of the independent variable by:
- within a range of values of the independent variable, designating subranges of the independent variable for which the value of each dependent variable is constant;
- and
- evaluating the function from values of the dependent variables exactly once for each designated subrange of the independent variable, wherein the dataset is stored in one or more database tables, wherein the designating and evaluating includes performing at least one query on the database tables.
A method in a computer system for, from a dataset of one or more dependent variables expressed relative to an independent variable, the dataset comprising a plurality of data points each indicating a value of each of the dependent variables for a particular value of the independent variable, evaluating a function of the dependent variables in terms of the independent variable, comprising:
- identifying the data point having the smallest value of the independent variable,
- identifying data points at which the value of at least one of the dependent variables varies from the value of the same dependent variable at the data point having the next smaller value of the independent variable, and
- evaluating the function from values of the dependent variables at only the idenfified data points, wherein the dataset is stored in one or more database tables, and wherein the identifing and evaluating includes performing at least one query on the database tables.
A method in a computer system for analyzing a dataset of one or more dependent variables expressed relative to an independent variable, comprising:
- within a range of values of the independent variable, identifying subranges of the independent variable for which the value of each dependent variable is constant;
- and
- storing an indication of the identified subranges, wherein the dataset is stored in one or more database tables, and wherein the indentifying includes performing at least one query on the database tables, so that the stored indication of the identified subranges may be used to evaluate the function from values of the dependent variables exactly once for each identified subrange of the independent variable.
A computer-readable medium whose contents cause a computer system to analyzing a dataset of one or more dependent variables expressed relative to an independent variable by:
- for each dependent variable, identifying subranges of the independent variable for which the value of the dependent variable is constant;
- and
- for each dependent variable, storing an indication of the identified subranges, wherein the dataset is stored in one or more database tables, and wherein the indentifying includes performing at least one query on the database tables, so that the stored indications of the identified subranges may be used to evaluate a function from values of one or more of the dependent variables.
An apparatus for evaluating a function of the dependent variables in terms of the independent variable, comprising:
- a subrange identifier that, within a range of values of the independent variable, identifies subranges of the independent variable for which the value of each dependent variable is constant;
- and
- a function evaluator that exactly once for each identified subrange of the independent variable evaluates the function from the values of the dependent variables within the subrange, wherein the dataset is stored in one or more database tables, and wherein the identifying and evaluating includes performing at least one query on the database tables.
A computer memory storing a function result data structure for containing the result of a function of one or more dependent variables expressed in terms of an independent variable, the function result data structure comprising one entry for each of a plurality of ranges of the independent variable, each entry indicating a value of the function and indicating the range of the independent variable for which the value of the function holds.
A generated data signal conveying a function result data structure for containing the result of a function of one or more dependent variables expressed in terms of an independent variable, the function result data structure comprising one entry for each of a plurality of ranges of the independent variable, each entry indicating a value of the function and indicating the range of the independent variable for which the value of the function holds.
Dependencies are inferred from the claim text.