|
28 | 28 | #include "engine/Sort.h" |
29 | 29 | #include "engine/TextIndexScanForEntity.h" |
30 | 30 | #include "engine/TextIndexScanForWord.h" |
31 | | -#include "engine/TextOperationWithFilter.h" |
32 | | -#include "engine/TextOperationWithoutFilter.h" |
33 | 31 | #include "engine/TransitivePath.h" |
34 | 32 | #include "engine/Union.h" |
35 | 33 | #include "engine/Values.h" |
@@ -1704,13 +1702,6 @@ std::vector<QueryPlanner::SubtreePlan> QueryPlanner::createJoinCandidates( |
1704 | 1702 | // The candidates are not connected |
1705 | 1703 | return candidates; |
1706 | 1704 | } |
1707 | | - // Find join variable(s) / columns. |
1708 | | - if (jcs.size() == 2 && (a._qet->getType() == TEXT_WITHOUT_FILTER || |
1709 | | - b._qet->getType() == TEXT_WITHOUT_FILTER)) { |
1710 | | - LOG(WARN) << "Not considering possible join on " |
1711 | | - << "two columns, if they involve text operations.\n"; |
1712 | | - return candidates; |
1713 | | - } |
1714 | 1705 |
|
1715 | 1706 | if (a.type == SubtreePlan::MINUS) { |
1716 | 1707 | AD_THROW( |
@@ -1753,14 +1744,6 @@ std::vector<QueryPlanner::SubtreePlan> QueryPlanner::createJoinCandidates( |
1753 | 1744 | return candidates; |
1754 | 1745 | } |
1755 | 1746 |
|
1756 | | - // If one of the join results is a text operation without filter |
1757 | | - // also consider using the other one as filter and thus |
1758 | | - // turning this join into a text operation with filter, instead. |
1759 | | - if (auto opt = createJoinAsTextFilter(a, b, jcs)) { |
1760 | | - // It might still be cheaper to perform a "normal" join, so we are simply |
1761 | | - // adding this to the candidate plans and not returning. |
1762 | | - candidates.push_back(std::move(opt.value())); |
1763 | | - } |
1764 | 1747 | // Check if one of the two operations is a HAS_PREDICATE_SCAN. |
1765 | 1748 | // If the join column corresponds to the has-predicate scan's |
1766 | 1749 | // subject column we can use a specialized join that avoids |
@@ -1868,40 +1851,6 @@ auto QueryPlanner::createJoinWithHasPredicateScan( |
1868 | 1851 | return plan; |
1869 | 1852 | } |
1870 | 1853 |
|
1871 | | -// ______________________________________________________________________________________ |
1872 | | -auto QueryPlanner::createJoinAsTextFilter( |
1873 | | - SubtreePlan a, SubtreePlan b, |
1874 | | - const std::vector<std::array<ColumnIndex, 2>>& jcs) |
1875 | | - -> std::optional<SubtreePlan> { |
1876 | | - using enum QueryExecutionTree::OperationType; |
1877 | | - if (!(a._qet->getType() == TEXT_WITHOUT_FILTER || |
1878 | | - b._qet->getType() == TEXT_WITHOUT_FILTER)) { |
1879 | | - return std::nullopt; |
1880 | | - } |
1881 | | - // If one of the join results is a text operation without filter |
1882 | | - // also consider using the other one as filter and thus |
1883 | | - // turning this join into a text operation with filter, instead, |
1884 | | - bool aTextOp = true; |
1885 | | - // If both are TextOps, the smaller one will be used as filter. |
1886 | | - if (a._qet->getType() != TEXT_WITHOUT_FILTER || |
1887 | | - (b._qet->getType() == TEXT_WITHOUT_FILTER && |
1888 | | - b._qet->getSizeEstimate() > a._qet->getSizeEstimate())) { |
1889 | | - aTextOp = false; |
1890 | | - } |
1891 | | - const auto& textPlanTree = aTextOp ? a._qet : b._qet; |
1892 | | - const auto& filterTree = aTextOp ? b._qet : a._qet; |
1893 | | - size_t otherPlanJc = aTextOp ? jcs[0][1] : jcs[0][0]; |
1894 | | - const TextOperationWithoutFilter& noFilter = |
1895 | | - *static_cast<const TextOperationWithoutFilter*>( |
1896 | | - textPlanTree->getRootOperation().get()); |
1897 | | - auto qec = textPlanTree->getRootOperation()->getExecutionContext(); |
1898 | | - SubtreePlan plan = makeSubtreePlan<TextOperationWithFilter>( |
1899 | | - qec, noFilter.getWordPart(), noFilter.getVars(), noFilter.getCVar(), |
1900 | | - filterTree, otherPlanJc); |
1901 | | - mergeSubtreePlanIds(plan, a, b); |
1902 | | - return plan; |
1903 | | -} |
1904 | | - |
1905 | 1854 | // _____________________________________________________________________ |
1906 | 1855 | void QueryPlanner::QueryGraph::setupGraph( |
1907 | 1856 | const std::vector<SubtreePlan>& leafOperations) { |
|
0 commit comments