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

Refactoring the ParsedQuery class #323

Merged
merged 12 commits into from
Apr 24, 2020
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
endif()
endif()

## Build targets for address sanitizer
# AddressSanitize
set(CMAKE_C_FLAGS_ASAN
"-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
CACHE STRING "Flags used by the C compiler during AddressSanitizer builds."
FORCE)
set(CMAKE_CXX_FLAGS_ASAN
"-fsanitize=address -fno-optimize-sibling-calls -fsanitize-address-use-after-scope -fno-omit-frame-pointer -g -O1"
CACHE STRING "Flags used by the C++ compiler during AddressSanitizer builds."
FORCE)

###############################################################################
##### Essential settings #####
###############################################################################
Expand Down Expand Up @@ -124,6 +135,7 @@ message(STATUS "CXX_FLAGS are : " ${CMAKE_CXX_FLAGS})
message(STATUS "CXX_FLAGS_RELEASE are : " ${CMAKE_CXX_FLAGS_RELEASE})
message(STATUS "CXX_FLAGS_DEBUG are : " ${CMAKE_CXX_FLAGS_DEBUG})
message(STATUS "IMPORTANT: Make sure you have selected the desired CMAKE_BUILD_TYPE")
message(STATUS "CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
message(STATUS ---)

###############################################################################
Expand Down
408 changes: 197 additions & 211 deletions src/engine/QueryPlanner.cpp

Large diffs are not rendered by default.

11 changes: 4 additions & 7 deletions src/engine/QueryPlanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ class QueryPlanner {
void addAllNodes(uint64_t otherNodes);
};

TripleGraph createTripleGraph(
std::shared_ptr<const ParsedQuery::GraphPattern> pattern) const;
TripleGraph createTripleGraph(const ParsedQuery::GraphPattern* pattern) const;

static ad_utility::HashMap<string, size_t>
createVariableColumnsMapForTextOperation(
Expand Down Expand Up @@ -190,8 +189,7 @@ class QueryPlanner {

bool _enablePatternTrick;

std::vector<SubtreePlan> optimize(
std::shared_ptr<const ParsedQuery::GraphPattern> pattern);
std::vector<SubtreePlan> optimize(ParsedQuery::GraphPattern* rootPattern);

/**
* @brief Fills varToTrip with a mapping from all variables in the root graph
Expand Down Expand Up @@ -252,9 +250,8 @@ class QueryPlanner {
std::string generateUniqueVarName();

// Creates a tree of unions with the given patterns as the trees leaves
std::shared_ptr<ParsedQuery::GraphPattern> uniteGraphPatterns(
const std::vector<std::shared_ptr<ParsedQuery::GraphPattern>>& patterns)
const;
ParsedQuery::GraphPattern uniteGraphPatterns(
std::vector<ParsedQuery::GraphPattern>&& patterns) const;

/**
* @brief Merges two rows of the dp optimization table using various types of
Expand Down