Skip to content

Commit

Permalink
Remove some unused functions in the query planner (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
joka921 authored Sep 6, 2022
1 parent 754a1fa commit 8e2238b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 69 deletions.
37 changes: 0 additions & 37 deletions src/engine/QueryPlanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2487,43 +2487,6 @@ bool QueryPlanner::TripleGraph::isSimilar(
return true;
}

// _____________________________________________________________________________
bool QueryPlanner::TripleGraph::isPureTextQuery() {
return _nodeStorage.size() == 1 && _nodeStorage.begin()->_cvar.size() > 0;
}

// _____________________________________________________________________________
ad_utility::HashMap<string, size_t>
QueryPlanner::createVariableColumnsMapForTextOperation(
const string& contextVar, const string& entityVar,
const ad_utility::HashSet<string>& freeVars,
const vector<pair<QueryExecutionTree, size_t>>& subtrees) {
AD_CHECK(!contextVar.empty());
ad_utility::HashMap<string, size_t> map;
size_t n = 0;
if (!entityVar.empty()) {
map[entityVar] = n++;
map[absl::StrCat(TEXTSCORE_VARIABLE_PREFIX, contextVar.substr(1))] = n++;
map[contextVar] = n++;
} else {
map[contextVar] = n++;
map[absl::StrCat(TEXTSCORE_VARIABLE_PREFIX, contextVar.substr(1))] = n++;
}

for (const auto& v : freeVars) {
map[v] = n++;
}

for (const auto& subtree : subtrees) {
size_t offset = n;
for (const auto& [variable, index] : subtree.first.getVariableColumns()) {
map[variable] = offset + index;
++n;
}
}
return map;
}

// _____________________________________________________________________________
void QueryPlanner::setEnablePatternTrick(bool enablePatternTrick) {
_enablePatternTrick = enablePatternTrick;
Expand Down
32 changes: 0 additions & 32 deletions src/engine/QueryPlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ class QueryPlanner {

void collapseTextCliques();

bool isPureTextQuery();

private:
vector<pair<TripleGraph, vector<SparqlFilter>>> splitAtContextVars(
const vector<SparqlFilter>& origFilters,
Expand Down Expand Up @@ -161,36 +159,6 @@ class QueryPlanner {
TripleGraph createTripleGraph(
const GraphPatternOperation::BasicGraphPattern* pattern) const;

static ad_utility::HashMap<string, size_t>
createVariableColumnsMapForTextOperation(
const string& contextVar, const string& entityVar,
const ad_utility::HashSet<string>& freeVars,
const vector<pair<QueryExecutionTree, size_t>>& subtrees);

static ad_utility::HashMap<string, size_t>
createVariableColumnsMapForTextOperation(
const string& contextVar, const string& entityVar,
const vector<pair<QueryExecutionTree, size_t>>& subtrees) {
return createVariableColumnsMapForTextOperation(
contextVar, entityVar, ad_utility::HashSet<string>(), subtrees);
};

static ad_utility::HashMap<string, size_t>
createVariableColumnsMapForTextOperation(const string& contextVar,
const string& entityVar) {
return createVariableColumnsMapForTextOperation(
contextVar, entityVar, vector<pair<QueryExecutionTree, size_t>>());
}

static ad_utility::HashMap<string, size_t>
createVariableColumnsMapForTextOperation(
const string& contextVar, const string& entityVar,
const ad_utility::HashSet<string>& freeVars) {
return createVariableColumnsMapForTextOperation(
contextVar, entityVar, freeVars,
vector<pair<QueryExecutionTree, size_t>>());
};

void setEnablePatternTrick(bool enablePatternTrick);

// Create a set of possible execution trees for the given parsed query. The
Expand Down

0 comments on commit 8e2238b

Please sign in to comment.