Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete old and by now unused code for answering full-text queries #1231

Merged
merged 3 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ add_library(SortPerformanceEstimator SortPerformanceEstimator.cpp)
qlever_target_link_libraries(SortPerformanceEstimator)
add_library(engine
Engine.cpp QueryExecutionTree.cpp Operation.cpp ResultTable.cpp LocalVocab.cpp
IndexScan.cpp Join.cpp Sort.cpp TextOperationWithoutFilter.cpp
TextOperationWithFilter.cpp Distinct.cpp OrderBy.cpp Filter.cpp
IndexScan.cpp Join.cpp Sort.cpp
Distinct.cpp OrderBy.cpp Filter.cpp
Server.cpp QueryPlanner.cpp QueryPlanningCostFactors.cpp
OptionalJoin.cpp CountAvailablePredicates.cpp GroupBy.cpp HasPredicateScan.cpp
Union.cpp MultiColumnJoin.cpp TransitivePath.cpp Service.cpp
Expand Down
10 changes: 0 additions & 10 deletions src/engine/QueryExecutionTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#include "engine/Sort.h"
#include "engine/TextIndexScanForEntity.h"
#include "engine/TextIndexScanForWord.h"
#include "engine/TextOperationWithFilter.h"
#include "engine/TextOperationWithoutFilter.h"
#include "engine/TransitivePath.h"
#include "engine/Union.h"
#include "engine/Values.h"
Expand Down Expand Up @@ -174,10 +172,6 @@ void QueryExecutionTree::setOperation(std::shared_ptr<Op> operation) {
type_ = NEUTRAL_ELEMENT;
} else if constexpr (std::is_same_v<Op, Join>) {
type_ = JOIN;
} else if constexpr (std::is_same_v<Op, TextOperationWithFilter>) {
type_ = TEXT_WITH_FILTER;
} else if constexpr (std::is_same_v<Op, TextOperationWithoutFilter>) {
type_ = TEXT_WITHOUT_FILTER;
} else if constexpr (std::is_same_v<Op, TextIndexScanForWord>) {
type_ = TEXT_INDEX_SCAN_FOR_WORD;
} else if constexpr (std::is_same_v<Op, TextIndexScanForEntity>) {
Expand Down Expand Up @@ -219,10 +213,6 @@ template void QueryExecutionTree::setOperation(std::shared_ptr<Filter>);
template void QueryExecutionTree::setOperation(
std::shared_ptr<NeutralElementOperation>);
template void QueryExecutionTree::setOperation(std::shared_ptr<Join>);
template void QueryExecutionTree::setOperation(
std::shared_ptr<TextOperationWithFilter>);
template void QueryExecutionTree::setOperation(
std::shared_ptr<TextOperationWithoutFilter>);
template void QueryExecutionTree::setOperation(
std::shared_ptr<TextIndexScanForWord>);
template void QueryExecutionTree::setOperation(
Expand Down
2 changes: 0 additions & 2 deletions src/engine/QueryExecutionTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class QueryExecutionTree {
ORDER_BY,
FILTER,
DISTINCT,
TEXT_WITHOUT_FILTER,
TEXT_WITH_FILTER,
TEXT_INDEX_SCAN_FOR_WORD,
TEXT_INDEX_SCAN_FOR_ENTITY,
OPTIONAL_JOIN,
Expand Down
51 changes: 0 additions & 51 deletions src/engine/QueryPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#include "engine/Sort.h"
#include "engine/TextIndexScanForEntity.h"
#include "engine/TextIndexScanForWord.h"
#include "engine/TextOperationWithFilter.h"
#include "engine/TextOperationWithoutFilter.h"
#include "engine/TransitivePath.h"
#include "engine/Union.h"
#include "engine/Values.h"
Expand Down Expand Up @@ -1704,13 +1702,6 @@ std::vector<QueryPlanner::SubtreePlan> QueryPlanner::createJoinCandidates(
// The candidates are not connected
return candidates;
}
// Find join variable(s) / columns.
if (jcs.size() == 2 && (a._qet->getType() == TEXT_WITHOUT_FILTER ||
b._qet->getType() == TEXT_WITHOUT_FILTER)) {
LOG(WARN) << "Not considering possible join on "
<< "two columns, if they involve text operations.\n";
return candidates;
}

if (a.type == SubtreePlan::MINUS) {
AD_THROW(
Expand Down Expand Up @@ -1753,14 +1744,6 @@ std::vector<QueryPlanner::SubtreePlan> QueryPlanner::createJoinCandidates(
return candidates;
}

// If one of the join results is a text operation without filter
// also consider using the other one as filter and thus
// turning this join into a text operation with filter, instead.
if (auto opt = createJoinAsTextFilter(a, b, jcs)) {
// It might still be cheaper to perform a "normal" join, so we are simply
// adding this to the candidate plans and not returning.
candidates.push_back(std::move(opt.value()));
}
// Check if one of the two operations is a HAS_PREDICATE_SCAN.
// If the join column corresponds to the has-predicate scan's
// subject column we can use a specialized join that avoids
Expand Down Expand Up @@ -1868,40 +1851,6 @@ auto QueryPlanner::createJoinWithHasPredicateScan(
return plan;
}

// ______________________________________________________________________________________
auto QueryPlanner::createJoinAsTextFilter(
SubtreePlan a, SubtreePlan b,
const std::vector<std::array<ColumnIndex, 2>>& jcs)
-> std::optional<SubtreePlan> {
using enum QueryExecutionTree::OperationType;
if (!(a._qet->getType() == TEXT_WITHOUT_FILTER ||
b._qet->getType() == TEXT_WITHOUT_FILTER)) {
return std::nullopt;
}
// If one of the join results is a text operation without filter
// also consider using the other one as filter and thus
// turning this join into a text operation with filter, instead,
bool aTextOp = true;
// If both are TextOps, the smaller one will be used as filter.
if (a._qet->getType() != TEXT_WITHOUT_FILTER ||
(b._qet->getType() == TEXT_WITHOUT_FILTER &&
b._qet->getSizeEstimate() > a._qet->getSizeEstimate())) {
aTextOp = false;
}
const auto& textPlanTree = aTextOp ? a._qet : b._qet;
const auto& filterTree = aTextOp ? b._qet : a._qet;
size_t otherPlanJc = aTextOp ? jcs[0][1] : jcs[0][0];
const TextOperationWithoutFilter& noFilter =
*static_cast<const TextOperationWithoutFilter*>(
textPlanTree->getRootOperation().get());
auto qec = textPlanTree->getRootOperation()->getExecutionContext();
SubtreePlan plan = makeSubtreePlan<TextOperationWithFilter>(
qec, noFilter.getWordPart(), noFilter.getVars(), noFilter.getCVar(),
filterTree, otherPlanJc);
mergeSubtreePlanIds(plan, a, b);
return plan;
}

// _____________________________________________________________________
void QueryPlanner::QueryGraph::setupGraph(
const std::vector<SubtreePlan>& leafOperations) {
Expand Down
236 changes: 0 additions & 236 deletions src/engine/TextOperationWithFilter.cpp

This file was deleted.

Loading