Memory usage query governor
AssigneeInternational Business Machines Corporation
InventorsEric L. Barsness, Paul S. Nelsestuen, John M. Santosuosso
Life of this patent
Estimating the term…
Abstract
Techniques for managing query execution based on memory usage using memory compression. Embodiments may receive a query from a requesting entity and estimate an amount of memory required to execute the query. Upon determining that executing the query would consume an impermissible amount of memory, embodiments may optimize the query by adjusting an amount of memory compression used in executing the query. The optimized query may then be executed to produce a set of query results, which may then be returned to the requesting entity.
Claims25
A computer-implemented method for managing query execution, comprising:
- calculating an estimated memory usage value for executing a query, based at least in part on historical memory usage data relating to previously processed queries, wherein the estimated memory usage value approximates a total amount of memory that will be used when the query is executed, and wherein the estimated memory usage value is calculated before the received query is executed;
- determining whether executing the query would satisfy a memory consumption condition by comparing the estimated memory usage value with a predetermined threshold amount of memory;
- and
- upon determining that executing the query would not satisfy the memory consumption condition, and by operation of one or more computer processors:
- determining one or more optimizations for the query adapted to reduce an amount of memory used when the query is executed, such that the memory consumption condition will be satisfied when the query is executed;
- optimizing the query based on the determined one or more optimizations;
- and
- executing the optimized query to produce a first set of query results.
A computer program product for managing query execution, comprising:
- a computer-readable memory having computer readable program code embodied therewith, the computer readable program code comprising:
- computer readable program code to calculate an estimated memory usage value for executing a query, based at least in part on historical memory usage data relating to previously processed queries, wherein the estimated memory usage value approximates a total amount of memory that will be used when the query is executed, and wherein the estimated memory usage value is calculated before the received query is executed;
- computer readable program code to determine whether executing the query would satisfy a memory consumption condition by comparing the estimated memory usage value with a predetermined threshold amount of memory;
- and
- computer readable program code to, upon determining that executing the query would not satisfy the memory consumption condition:
- determine one or more optimizations for the query adapted to reduce an amount of memory used when the query is executed, such that the memory consumption condition will be satisfied when the query is executed;
- optimize the query to reduce an amount of memory used in executing the query;
- and
- execute the optimized query to produce a first set of query results.
A system, comprising:
- a computer processor;
- and
- a memory containing a program that, when executed on the computer processor, performs an operation for managing query execution, comprising:
- calculating an estimated memory usage value for executing a query, based at least in part on historical memory usage data relating to previously processed queries, wherein the estimated memory usage value approximates a total amount of memory that will be used when the query is executed, and wherein the estimated memory usage value is calculated before the received query is executed;
- determining whether executing the query would satisfy a memory consumption condition by comparing the estimated memory usage value with a predetermined threshold amount of memory;
- and
- upon determining that executing the query would not satisfy the memory consumption condition, and by operation of one or more computer processors:
- determining one or more optimizations for the query adapted to reduce an amount of memory used when the query is executed, such that the memory consumption condition will be satisfied when the query is executed;
- optimizing the query based on the determined one or more optimizations;
- and
- executing the optimized query to produce a first set of query results.
Dependencies are inferred from the claim text.