CPC G06F 16/24542 (2019.01) [G06F 11/3419 (2013.01); G06F 16/24537 (2019.01); G06N 20/00 (2019.01)] | 13 Claims |
1. A computer-implemented method comprising:
receiving a query;
generating two or more access plans for the query;
dynamically generating, in response to the generating the two or more access plans and for each of the two or more access plans, a machine learning model based on each access plan, wherein the dynamically generating includes extracting, for each of the two or more access plans, a set of mini plans, the extracting includes dividing each access plan into the set of mini plans, each mini plan has an associated command in the query and each mini plan is associated with at least one mini model;
estimating, by the machine learning model, for each of the two or more access plans, a predicted resource cost to execute the query, wherein each mini plan is associated with a first mini model and a second mini model, wherein the first mini model is configured to estimate a resource cost to perform the associated command, based on a number of qualified rows, and the second mini model is configured to estimate the number of qualified rows for the associated command;
selecting, based on the predicted resource cost, a first access plan associated with a lowest resource cost of the predicted resource costs; and
executing, in response to the selecting, the query according to the first access plan.
|