Queries with hard time constraints
AssigneeOracle International Corporation
InventorsYing Hu, Seema Sundara, Jagannathan Srinivasan
Life of this patent
Estimating the term…
Abstract
Systems, methodologies, media, and other embodiments associated with supporting queries with hard time constraints are described. One exemplary system embodiment includes logic for accepting a query having a hard time constraint. The example system may also include logic for selectively rewriting the query having the hard time constraint into a query having a row limitation or a sample percentage limitation. In one example, the row limitation or sample percentage limitation are computed by repetitively comparing an estimated query execution time to the hard time constraint. The example system may also include logic for establishing a timer(s) associated with the rewritten query.
Claims22
A system, comprising:
- a rewrite logic embodied on a non-transitory computer-readable medium and configured to identify a blocking operation in a first query having a hard time constraint and to selectively produce a rewritten query based on the first query by, at least, rewriting a child operation in the blocking operation based, at least in part, on the hard time constraint, where the rewritten query includes a plurality of child operations;
- and
- a timer logic to establish a top level timer associated with execution of the rewritten query, and one or more action timers associated with execution of the child operations in the rewritten query, where the execution of the child operations in the rewritten query is terminated on expiration of an action timer associated with the child operation, where the action timer associated with the child operation is set to a predicted execution time for the child operation.
A non-transitory computer-readable medium storing processor executable instructions that when executed by a processor cause the processor to perform a method, the method comprising:
- identifying a blocking operation in a first statement having a hard time constraint clause that includes a hard time constraint, the first statement describing a desired processing of one or more rows from a set of tables;
- determining an execution time estimate for the first statement;
- selecting from the set of tables a subset of tables from which row selection is to be limited, where the subset of tables is selected based, at least in part, on the hard time constraint clause and the execution time estimate;
- selecting a method by which row selection from a member of the subset of tables is to be limited, where the method selected is based, at least in part, on the hard time constraint clause and the execution time estimate;
- selecting an amount by which row selection from a member of the subset of tables is to be limited, where the amount selected is based, at least in part, on the hard time constraint clause and the execution time estimate;
- providing a second statement based, at least in part, on the hard time constraint and having at least one additional clause to limit selection of rows from a member of the subset of tables by the selected amount according to the selected method, the second select statement being based on the first select statement and being composed of a set of sub-operations including a sub-operation associated with the blocking operation;
- and
- establishing a top level timer associated with the second statement, and one or more action timers associated with one or more sub-operations in the set of sub-operations, where execution of the second statement is controlled, at least in part, by the top level timer and the one or more action timers by selectively terminating execution of a sub-operation when an associated action timer expires, where the sub-operation associated with the blocking operation is set to an estimated execution time for the sub-operation.
A method, comprising:
- determining one or more of, an action to limit, a limitation method, and a limitation amount, where the action to limit, the limitation method, and the limitation amount are associated with a rewritten statement that accesses a database table, where executing the rewritten statement causes at least one action, and where the rewritten statement includes a blocking operation;
- establishing a top level timer, and an action timer, where a top level timer is set to control an overall execution time for the blocking operation by terminating execution of the blocking operation based on the overall timer, and where an action timer is set to control execution time for a sub-operation in executing the blocking operation by at least terminating execution of the sub-operation when the action timer expires;
- and
- setting the action timer to a predicted time for executing the sub-operation by storing a value on a non-transitory computer-readable medium.
A system, comprising:
- a non-transitory computer-readable medium comprising a means for computing a plurality of predicted execution times for a plurality of child operations of a query;
- means for selectively rewriting the query based, at least in part, on identifying a blocking operation in the query, where rewriting the query includes rewriting a child operation in the blocking operation based, at least in part, on the plurality of predicted execution times and a time constraint;
- means for establishing a top level timer, and one or more action timers, where the top level timer is set to control an overall execution time for the query, and where an action timer is set to control execution time for the child operation in the blocking operation in the query;
- and
- means for selectively terminating the child operation in the blocking operation of the query based, at least in part, on expiration of an action timer associated with a predicted execution time for the child operation in the blocking operation and the time constraint, where the action timer for the child operation in the blocking operation is set to a predicted execution time for the child operation.
A non-transitory computer-readable medium storing processor executable instructions that when executed by a processor cause the processor to perform a method, the method comprising:
- identifying a blocking operation in a query, where the query includes a plurality of child operations and a hard time constraint;
- producing a rewritten query based on the query by rewriting a child operation in the blocking operation based, at least in part, on the hard time constraint;
- and
- establishing a top level timer associated with execution of the rewritten query, and at least one action timer associated with execution of a child operation in the rewritten query, where the execution of the child operation in the rewritten query is terminated on expiration of an action timer associated with the child operation, where an action timer associated with the child operation in the blocking operation is set to a predicted execution time for the child operation.
Dependencies are inferred from the claim text.