US 10,891,290 B2
Query plan searching and optimization
John Mark Morris, Escondido, CA (US); Bhashyam Ramesh, Secunderabad (IN); Donald Raymond Pederson, San Diego, CA (US); and Kuorong Chiang, Buena Park, CA (US)
Assigned to Teradata US, Inc., San Diego, CA (US)
Filed by Teradata US, Inc., Dayton, OH (US)
Filed on Dec. 22, 2017, as Appl. No. 15/852,597.
Prior Publication US 2019/0197163 A1, Jun. 27, 2019
Int. Cl. G06F 16/00 (2019.01); G06F 16/2453 (2019.01)
CPC G06F 16/24545 (2019.01) [G06F 16/24542 (2019.01)] 19 Claims
OG exemplary drawing
 
1. A method, comprising:
identifying a search space for a query, the search space including possible query execution plans for executing the query;
subdividing the possible execution plans in the search space among sub search spaces;
using resources to perform a search to obtain plan costs for the query execution plans;
maintaining a resource cost as the search is performed, wherein the resource cost is associated with the cost of using the resources to perform the search so far and the cost of continuing to utilize the resources to complete the search;
normalizing the resource cost into a same unit of measure as that which is associated with the plan costs; and
selecting an optimal execution plan from the query execution plans for which plan costs have been obtained when the resource cost reaches a threshold.