Discovery of potential problematic execution plans in a bind-sensitive query statement
AssigneeDell Products L.P.
InventorsWai Yip To, Ka Wing Ellis Luk
Life of this patent
Estimating the term…
Abstract
Aspects of the present invention provide systems and methods that can help generate potential execution plans for a query statement that have one or more bind variable, whether the one or more bind variables were originally in the query statement or replaced one or more literals in the query. Embodiments of the present invention also include systems and methods for testing performance of one or more of the potential execution plans before they emerge in the production environment.
Claims20
A computer-implemented method for discovery of one or more execution plans for a bind-sensitive query statement comprising:
- for each bind variable from a set of one or more bind variables identified in a bind-sensitive query statement, preparing how values are to be generated for the bind variable;
- calculating a quota for evaluating the bind-sensitive query statement;
- and
- performing the following steps while the quota is not exhausted:
- generating a new set of bind values for at least one bind variable from the set of one or more bind variables;
- evaluating whether a new execution plan is generated by a database system by the new set of bind values;
- and
- responsive to a new execution plan being generated, storing the new execution plan with the set of bind values in a memory.
A system for discovering an execution plan for a bind-sensitive query statement, the system comprising:
- one or more processors;
- one or more memory components communicatively coupled to the processor;
- an interface communicatively coupled to the processor that facilitates accessing one or more databases;
- and
- a bind-sensitive query execution plan discovery subsystem that comprises:
- a bind value candidates preparer module that, for each bind variables from a set of one or more bind variables identified in a bind variable query statement, gathers information about how a value or values may be generated for the bind variable by evaluating which of a set of methods may be used to obtain a value or values for the bind variable;
- a bind value generation module that:
- receives the bind variable query statement;
- receives information from the bind value candidates preparer module comprising one or more methods for generating a bind value or values for one or more bind variables in the bind variable query statement;
- and
- generates, for each iteration in a set of iterations, a new set of bind values for at least one bind variable from the set of one or more bind variables for use in generating an execution plan using the new set of bind values:
- and
- a unique execution plan detection module that, for each iteration from the set of iterations:
- receives the generated execution plans;
- determines whether the generated execution plan is unique;
- and
- responsive to the generated execution plan being unique, stores in memory the generated execution plan to a unique execution plan datastore along with the new set of bind values associated with the generated execution plan.
A non-transitory computer readable medium or media comprising one or more sequences of instructions which, when executed by one or more processors, causes steps for discovery of one or more execution plans for a bind-sensitive query statement comprising:
- for each bind variable from a set of one or more bind variables identified in a bind-sensitive query statement, preparing how values are to be generated for the bind variable;
- calculating a quota for evaluating the bind-sensitive query statement;
- and
- performing the following steps while the quota is not exhausted:
- generating a new set of bind values for at least one bind variable from the set of one or more bind variables;
- evaluating whether a new execution plan is generated by a database system by the new set of bind values;
- and
- responsive to a new execution plan being generated, storing the new execution plan with the set of bind values in a memory.
Dependencies are inferred from the claim text.