Index join query optimization
In some implementations, there is provided a method including receiving a query request including a join, wherein the join includes a range between a first predicate of the join and a second predicate of the join; generating a query plan including an index join operator; executing the query plan including the index join operator including getting, from the sorted dictionary, the first value identifier, the second value identifier, and the one or more intervening value identifiers between the first value identifier and the second value identifier and executing the index join operator using the first value identifier, the second value identifier, and the one or more intervening value identifiers to obtain a result set.
1 . A system, comprising:
at least one data processor; and
at least one memory storing instructions which, when executed by the at least one data processor, cause operations comprising:
receiving a query request including a join, wherein the join includes a range between a first predicate of the join and a second predicate of the join, and the join selects from a first table and a second table one or more values based on the range between the first predicate and the second predicate;
generating a query plan including an index join operator, wherein the index join operator includes a join handler configured to get, from a sorted dictionary at query plan execution, a first value identifier corresponding to the first predicate, a second value identifier corresponding to the second predicate, and one or more intervening value identifiers between the first value identifier and the second value identifier,
wherein generating the query plan comprises generating a directed acyclic graph (DAG) comprising a plurality of operators including the index join operator, the plurality of operators being configured into one or more pipelines for execution;
executing the query plan including the index join operator, wherein the executing further comprises getting, from the sorted dictionary, the first value identifier, the second value identifier, and the one or more intervening value identifiers between the first value identifier and the second value identifier, and executing the index join operator using the first value identifier, the second value identifier, and the one or more intervening value identifiers to obtain a result set; and
responding to the query request by providing the result set.
2 . The system of claim 1 , wherein the query request is received at a database execution engine.
3 . The system of claim 1 , wherein the query plan is generated, by a database execution engine, in response to the query request that is received.
4 . The system of claim 1 , wherein the join handler is configured to include one or more instructions to perform the get from the sorted dictionary.
5 . The system of claim 1 , wherein the executing of the query plan including the index join operator is performed by at least a database execution engine.
6 . The system of claim 1 , wherein the index join operator includes the join handler, wherein the join handler gets from the sorted dictionary the first value identifier, the second value identifier, and the one or more intervening value identifiers.
7 . The system of claim 1 , wherein the index join operator includes the join handler, wherein the join handler executes the index join operator using the first value identifier, the second value identifier, and the one or more intervening value identifiers.
8 . A method comprising:
receiving a query request including a join, wherein the join includes a range between a first predicate of the join and a second predicate of the join, and the join selects from a first table and a second table one or more values based on the range between the first predicate and the second predicate;
generating a query plan including an index join operator, wherein the index join operator includes a join handler configured to get, from a sorted dictionary at query plan execution, a first value identifier corresponding to the first predicate, a second value identifier corresponding to the second predicate, and one or more intervening value identifiers between the first value identifier and the second value identifier,
wherein generating the query plan comprises generating a directed acyclic graph (DAG) comprising a plurality of operators including the index join operator, the plurality of operators being configured into one or more pipelines for execution;
executing the query plan including the index join operator, wherein the executing further comprises getting, from the sorted dictionary, the first value identifier, the second value identifier, and the one or more intervening value identifiers between the first value identifier and the second value identifier, and executing the index join operator using the first value identifier, the second value identifier, and the one or more intervening value identifiers to obtain a result set; and
responding to the query request by providing the result set.
9 . The method of claim 8 , wherein the query request is received at a database execution engine.
10 . The method of claim 8 , wherein the query plan is generated, by a database execution engine, in response to the query request that is received.
11 . The method of claim 8 , wherein the join handler is configured to include one or more instructions to perform the get from the sorted dictionary.
12 . The method of claim 8 , wherein the executing of the query plan including the index join operator is performed by at least a database execution engine.
13 . The method of claim 8 , wherein the index join operator includes the join handler, wherein the join handler gets from the sorted dictionary the first value identifier, the second value identifier, and the one or more intervening value identifiers.
14 . A non-transitory computer-readable medium including instructions which, when executed by at least one data processor, cause operations comprising:
receiving a query request including a join, wherein the join includes a range between a first predicate of the join and a second predicate of the join, and the join selects from a first table and a second table one or more values based on the range between the first predicate and the second predicate;
generating a query plan including an index join operator, wherein the index join operator includes a join handler configured to get, from a sorted dictionary at query plan execution, a first value identifier corresponding to the first predicate, a second value identifier corresponding to the second predicate, and one or more intervening value identifiers between the first value identifier and the second value identifier,
wherein generating the query plan comprises generating a directed acyclic graph (DAG) comprising a plurality of operators including the index join operator, the plurality of operators being configured into one or more pipelines for execution;
executing the query plan including the index join operator, wherein the executing further comprises getting, from the sorted dictionary, the first value identifier, the second value identifier, and the one or more intervening value identifiers between the first value identifier and the second value identifier, and executing the index join operator using the first value identifier, the second value identifier, and the one or more intervening value identifiers to obtain a result set; and
responding to the query request by providing the result set.
15 . The non-transitory computer-readable medium of claim 14 , wherein the query request is received at a database execution engine.
16 . The non-transitory computer-readable medium of claim 14 , wherein the query plan is generated, by a database execution engine, in response to the query request that is received.