CPC G06F 16/24542 (2019.01) [G06F 16/2455 (2019.01); G06F 16/24549 (2019.01)] | 20 Claims |
1. A method for dynamically selecting query execution operators, comprising:
at a computing device having one or more processors, volatile memory, and non- volatile memory, executing one or more programs to retrieve data from a database, including:
compiling a query execution tree for a query to form a first executable plan that includes a plurality of in-memory operators that execute within the volatile memory without swapping to the non-volatile memory;
initiating execution of the first executable plan, including initiating execution of a first plurality of in-memory operators in the first executable plan to run in parallel;
while executing a first in-memory operator of the first plurality of in-memory operators, detecting insufficient memory to complete execution of the first in-memory operator; and
in response to detecting insufficient memory to complete execution of the first in- memory operator:
aborting execution of the first executable plan;
recompiling the query execution tree to form a second executable plan that retains the first in-memory operator, but schedules the first in-memory operator to execute not in parallel with the other in-memory operators of the first plurality of in-memory operators, according to estimated available volatile memory;
executing the second executable plan to identify a set of results from the database that is responsive to the query; and
returning the set of results.
|