Query plan searching and optimization
AssigneeTeradata US, Inc.
InventorsJohn Mark Morris, Bhashyam Ramesh, Donald Raymond Pederson, Kuorong Chiang
Life of this patent
Estimating the term…
Abstract
Search spaces for obtaining query execution plans for a query are identified. The search spaces are subdivided into sub-search spaces. Searches are initiated within the sub search spaces and plan costs for competing query execution plans are noted along with search costs associated with continuing to search the sub-search spaces. A decision is made based on the plan costs and search costs for utilizing search resources as to when to terminate the searching and to select the then-existing lowest cost query execution plan as an optimal query execution plan for executing the query.
Claims20
A method, comprising:
- identifying search spaces for providing query execution plans for a query;
- subdividing the search spaces into sub-search spaces;
- obtaining plan costs being developed from resources of the sub-search spaces for the query execution plans;
- maintaining a resource cost associated with using the resources and continuing to utilize the resources;
- and
- selecting an optimal execution plan from the query execution plans based on the plan costs when the resource cost reach a threshold or when all possible query execution plans have been produced.
A method, comprising:
- identifying search resources for processing a query and developing query execution plans for the query or a portion of the query;
- providing the query or the portion of the query to the search resources;
- receiving plan costs as the query execution plans are developed by the search resources;
- maintaining a resource cost associated with use of and a continued use of the search resources;
- and
- selecting an optimal plan from the query execution plans as a current least cost plan based on the plan costs and the resource cost.
A system, comprising:
- a data warehouse including:
- a query plan searcher;
- wherein the query plan searcher is configured to:
- i) execute on at least one network node of the data warehouse, ii) identify search spaces having search resources for developing query execution plans for a query, iii) initiate the search resources with the query, iv) receive accumulating plan costs for the query execution plans as the search resources produce the query execution plans, v) maintain a total resource cost associated with processing the search resources and continued processing of the search resources, and vi) determine when to terminate the processing performed by the search resources and identify a lowest cost execution plan from the query execution plans as an optimal query execution plan based at least in part on the plan costs and the total resource cost.
Dependencies are inferred from the claim text.