Skip to content

Commit 0ac7d3f

Browse files
authored
Delete old and by now unused code for answering full-text queries (#1231)
Since #1093 we use a much simpler approach for answering full-text queries that contain `ql:contains-word` and `ql:contains-entity`. That PR made a lot of old code for the text index obsolete. This code is now deleted.
1 parent c80a31f commit 0ac7d3f

21 files changed

+9
-4065
lines changed

src/engine/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ add_library(SortPerformanceEstimator SortPerformanceEstimator.cpp)
33
qlever_target_link_libraries(SortPerformanceEstimator)
44
add_library(engine
55
Engine.cpp QueryExecutionTree.cpp Operation.cpp ResultTable.cpp LocalVocab.cpp
6-
IndexScan.cpp Join.cpp Sort.cpp TextOperationWithoutFilter.cpp
7-
TextOperationWithFilter.cpp Distinct.cpp OrderBy.cpp Filter.cpp
6+
IndexScan.cpp Join.cpp Sort.cpp
7+
Distinct.cpp OrderBy.cpp Filter.cpp
88
Server.cpp QueryPlanner.cpp QueryPlanningCostFactors.cpp
99
OptionalJoin.cpp CountAvailablePredicates.cpp GroupBy.cpp HasPredicateScan.cpp
1010
Union.cpp MultiColumnJoin.cpp TransitivePath.cpp Service.cpp

src/engine/QueryExecutionTree.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
#include "engine/Sort.h"
3131
#include "engine/TextIndexScanForEntity.h"
3232
#include "engine/TextIndexScanForWord.h"
33-
#include "engine/TextOperationWithFilter.h"
34-
#include "engine/TextOperationWithoutFilter.h"
3533
#include "engine/TransitivePath.h"
3634
#include "engine/Union.h"
3735
#include "engine/Values.h"
@@ -174,10 +172,6 @@ void QueryExecutionTree::setOperation(std::shared_ptr<Op> operation) {
174172
type_ = NEUTRAL_ELEMENT;
175173
} else if constexpr (std::is_same_v<Op, Join>) {
176174
type_ = JOIN;
177-
} else if constexpr (std::is_same_v<Op, TextOperationWithFilter>) {
178-
type_ = TEXT_WITH_FILTER;
179-
} else if constexpr (std::is_same_v<Op, TextOperationWithoutFilter>) {
180-
type_ = TEXT_WITHOUT_FILTER;
181175
} else if constexpr (std::is_same_v<Op, TextIndexScanForWord>) {
182176
type_ = TEXT_INDEX_SCAN_FOR_WORD;
183177
} else if constexpr (std::is_same_v<Op, TextIndexScanForEntity>) {
@@ -219,10 +213,6 @@ template void QueryExecutionTree::setOperation(std::shared_ptr<Filter>);
219213
template void QueryExecutionTree::setOperation(
220214
std::shared_ptr<NeutralElementOperation>);
221215
template void QueryExecutionTree::setOperation(std::shared_ptr<Join>);
222-
template void QueryExecutionTree::setOperation(
223-
std::shared_ptr<TextOperationWithFilter>);
224-
template void QueryExecutionTree::setOperation(
225-
std::shared_ptr<TextOperationWithoutFilter>);
226216
template void QueryExecutionTree::setOperation(
227217
std::shared_ptr<TextIndexScanForWord>);
228218
template void QueryExecutionTree::setOperation(

src/engine/QueryExecutionTree.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class QueryExecutionTree {
4343
ORDER_BY,
4444
FILTER,
4545
DISTINCT,
46-
TEXT_WITHOUT_FILTER,
47-
TEXT_WITH_FILTER,
4846
TEXT_INDEX_SCAN_FOR_WORD,
4947
TEXT_INDEX_SCAN_FOR_ENTITY,
5048
OPTIONAL_JOIN,

src/engine/QueryPlanner.cpp

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include "engine/Sort.h"
2929
#include "engine/TextIndexScanForEntity.h"
3030
#include "engine/TextIndexScanForWord.h"
31-
#include "engine/TextOperationWithFilter.h"
32-
#include "engine/TextOperationWithoutFilter.h"
3331
#include "engine/TransitivePath.h"
3432
#include "engine/Union.h"
3533
#include "engine/Values.h"
@@ -1704,13 +1702,6 @@ std::vector<QueryPlanner::SubtreePlan> QueryPlanner::createJoinCandidates(
17041702
// The candidates are not connected
17051703
return candidates;
17061704
}
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-
}
17141705

17151706
if (a.type == SubtreePlan::MINUS) {
17161707
AD_THROW(
@@ -1753,14 +1744,6 @@ std::vector<QueryPlanner::SubtreePlan> QueryPlanner::createJoinCandidates(
17531744
return candidates;
17541745
}
17551746

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-
}
17641747
// Check if one of the two operations is a HAS_PREDICATE_SCAN.
17651748
// If the join column corresponds to the has-predicate scan's
17661749
// subject column we can use a specialized join that avoids
@@ -1868,40 +1851,6 @@ auto QueryPlanner::createJoinWithHasPredicateScan(
18681851
return plan;
18691852
}
18701853

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-
19051854
// _____________________________________________________________________
19061855
void QueryPlanner::QueryGraph::setupGraph(
19071856
const std::vector<SubtreePlan>& leafOperations) {

src/engine/TextOperationWithFilter.cpp

Lines changed: 0 additions & 236 deletions
This file was deleted.

0 commit comments

Comments
 (0)