Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push down joins to the remote MongoDB servers.
If we have a join between two foreign tables from the same remote server, push that join down to the remote server instead of fetching all the rows for both the tables and performing a join locally. This will have a very significant win in many practical cases. Since it is very unclear that which of the operators are supported on the MongoDB servers, currently join involving only relational and arithmetic operators in join-clauses are pushed down to avoid any potential join failure. Also, only INNER and LEFT/RIGHT OUTER joins are supported, and not FULL, SEMI, and ANTI joins. Moreover, only joins between two tables are pushed down and not when either inner or outer relation is the join itself. We use an aggregate pipeline with the lookup operator. Also, the MongoDB server returns join results as an array, and thus to get in a tuple form we use the unwind operator. This patch also supports the partition-wise join push-down when the table is partitioned. FDW-138, Vaibhav Dalvi, reviewed by Suraj Kharage and Jeevan Chalke, with additional improvements by me. Tested by Rajkumar Raghuwanshi.
- Loading branch information