Executing filter subqueries using a parallel single cursor model
First Claim
1. A method comprising the steps of:
- receiving, at a database server, a first query that includes (1) a first select statement and (2) a second query in a clause of the first query, wherein the second query includes a second select statement;
determining, at the database server, to parallelize first operation of a subquery operation or a filter operation, wherein the subquery operation is an operation required to execute the-second query, wherein the filter operation uses results produced by the subquery operation;
determining, at the database server, not to parallelize a second operation, wherein the second operation is the other operation of the subquery operation or the filter operation;
wherein the database server determines not to parallelize the second operation based, at least in part, on one of more of;
a cost associated with parallelizing the second operation, data that declares an object involved in the second operation to be serial, or semantics of a predicate associated with the second operation;
generating an execution plan that includes representations corresponding to both the subquery operation and the filter operation;
using a set of slave processes to access either the execution plan or an equivalent execution plan, wherein the set of slave processes participate in parallel execution of the first operation; and
executing the second operation in serial;
wherein the method is performed by one or more computing devices.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques are provided for generating execution plans for, and executing, database statements that contain filter subqueries. Upon receiving a database statement that contains a filter subquery, the database server builds an execution plan that includes a filter operation that is fed by a subtree that corresponds to the subquery. The database server performs a cost analysis to determine whether (1) the filter operation should be parallelized, and (2) the subquery tree should be parallelized. Techniques are also described for generating plans and executing queries where (1) both the filter operation and the subquery subtree are parallelized, (2) the filter operation is parallelized but the subquery subtree operation is performed serially, and (3) the filter operation is performed serially but the subquery subtree operation is parallelized.
43 Citations
24 Claims
-
1. A method comprising the steps of:
-
receiving, at a database server, a first query that includes (1) a first select statement and (2) a second query in a clause of the first query, wherein the second query includes a second select statement; determining, at the database server, to parallelize first operation of a subquery operation or a filter operation, wherein the subquery operation is an operation required to execute the-second query, wherein the filter operation uses results produced by the subquery operation; determining, at the database server, not to parallelize a second operation, wherein the second operation is the other operation of the subquery operation or the filter operation; wherein the database server determines not to parallelize the second operation based, at least in part, on one of more of; a cost associated with parallelizing the second operation, data that declares an object involved in the second operation to be serial, or semantics of a predicate associated with the second operation; generating an execution plan that includes representations corresponding to both the subquery operation and the filter operation; using a set of slave processes to access either the execution plan or an equivalent execution plan, wherein the set of slave processes participate in parallel execution of the first operation; and executing the second operation in serial; wherein the method is performed by one or more computing devices. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A method comprising:
-
receiving, at a database server, a first query that includes (1) a first select statement and (2) a second query in a clause of the first query, wherein the second query includes a second select statement; determining, at the database server, whether to parallelize at least one of a subquery operation or a filter operation, wherein the subquery operation is an operation required to execute the second query, wherein the filter operation uses results produced by the subquery operation; in response to determining that at least one operation of the subquery operation or the filter operation is to be parallelized; generating and storing, in volatile or non-volatile memory, an execution plan that includes representations corresponding to both the subquery operation and the filter operation, and using a set of slave processes that are to participate in parallel execution of the at least one operation to access either the execution plan or an equivalent execution plan; wherein the database server determines whether to parallelize the subquery operation before determining whether to parallelize the filter operation; wherein the method is performed by one or more computing devices.
-
-
12. A method comprising:
-
receiving, at a database server, a first query that includes (1) a first select statement and (2) a second query in a clause of the first query, wherein the second query includes a second select statement; determining, at the database server, whether to parallelize at least one of a subquery operation or a filter operation, wherein the subquery operation is an operation required to execute the second query, wherein the filter operation uses results produced by the subquery operation; in response to determining that at least one operation of the subquery operation or the filter operation is to be parallelized; generating and storing, in volatile or non-volatile memory, an execution plan that includes representations corresponding to both the subquery operation and the filter operation, and using a set of slave processes that are to participate in parallel execution of the at least one operation to access either the execution plan or an equivalent execution plan; wherein the database server determines whether to parallelize the filter operation based, at least in part, on serial costs of the subquery operation and parallel costs of the subquery operation; wherein the method is performed by one or more computing devices.
-
-
13. One or more volatile or non-volatile machine-readable media storing instructions which, when executed by one or more processors, cause:
-
receiving, at a database server, a first query that includes (1) a first select statement and (2) a second query in a clause of the first query, wherein the second query includes a second select statement; determining, at the database server, to parallelize a first operation of a subquery operation or a filter operation, wherein the subquery operation is an operation required to execute the second query, wherein the filter operation uses results produced by the subquery operation; determining, at the database server, not to parallelize a second operation, wherein the second operation is the other operation of the subquery operation or the filter operation; wherein the database server determines not to parallelize the second operation based, at least in part, on one of more of; a cost associated with parallelizing the second operation, data that declares an object involved in the second operation to be serial, or semantics of a predicate associated with the second operation; generating an execution plan that includes representations corresponding to both the subquery operation and the filter operation; using a set of slave processes to access either the execution plan or an equivalent execution plan, wherein the set of slave processes participate in parallel execution of the first operation; and executing the second operation in serial. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22)
-
-
23. One or more volatile or non-volatile machine-readable media storing instructions which, when executed by one or more processors, cause:
-
receiving, at a database server, a first query that includes (1) a first select statement and (2) a second query in a clause of the first query, wherein the second query includes a second select statement; determining, at the database server, whether to parallelize at least one of a subquery operation or a filter operation, wherein the subquery operation is an operation required to execute the second query, wherein the filter operation uses results produced by the subquery operation; in response to determining that at least one operation of the subquery operation or the filter operation is to be parallelized; generating and storing, in volatile or non-volatile memory, an execution plan that includes representations corresponding to both the subquery operation and the filter operation, and using a set of slave processes that are to participate in parallel execution of the at least one operation to access either the execution plan or an equivalent execution plan; wherein the database server determines whether to parallelize the subquery operation before determining whether to parallelize the filter operation.
-
-
24. One or more volatile or non-volatile machine-readable media storing instructions which, when executed by one or more processors, cause:
-
receiving, at a database server, a first query that includes (1) a first select statement and (2) a second query in a clause of the first query, wherein the second query includes a second select statement; determining, at the database server, whether to parallelize at least one of a subquery operation or a filter operation, wherein the subquery operation is an operation required to execute the second query, wherein the filter operation uses results produced by the subquery operation; in response to determining that at least one operation of the subquery operation or the filter operation is to be parallelized; generating and storing, in volatile or non-volatile memory, an execution plan that includes representations corresponding to both the subquery operation and the filter operation, and using a set of slave processes that are to participate in parallel execution of the at least one operation to access either the execution plan or an equivalent execution plan; wherein the database server determines whether to parallelize the filter operation based, at least in part, on serial costs of the subquery operation and parallel costs of the subquery operation.
-
Specification