10000 Bug fix/internal issue #316 by gnusi · Pull Request #7911 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Bug fix/internal issue #316 #7911

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

Merged
merged 26 commits into from
Jan 10, 2019
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
714c08f
allow using scorers outside ArangoSearch view context
gnusi Dec 21, 2018
9bd05ae
ensure query is properly optimized after replacement of scorer functions
gnusi Dec 23, 2018
104c9db
do not apply `handleViewsRule` to queries without views
gnusi Dec 24, 2018
30a9e29
simplify optimization rule for ArangoSearch views
gnusi Dec 24, 2018
b440b63
show ArangoSearch view scorers in query explanation
gnusi Dec 25, 2018
31d273c
fix tests
gnusi Dec 25, 2018
0e5da98
Merge branch 'devel' of https://github.com/arangodb/arangodb into bug…
gnusi Dec 25, 2018
a6d1805
fix tests
gnusi Dec 26, 2018
3f985c0
add stub for scorer related tests
gnusi Dec 26, 2018
cffbead
Merge branch 'devel' of https://github.com/arangodb/arangodb into bug…
gnusi Jan 8, 2019
aa3ca2e
reformat
gnusi Jan 8, 2019
e0591ca
check variable depth in `ViewExpressionContext::getVariableValue`
gnusi Jan 8, 2019
6c7ef9e
add some tests
gnusi Jan 8, 2019
08504d2
address js test failures
gnusi Jan 8, 2019
a8bda86
address jslint errors
gnusi Jan 9, 2019
d930573
ensure `IResearchViewNode` exposes variables used in scorers
gnusi Jan 9, 2019
5733b0a
ensure scorers with expressions are deduplicated
gnusi Jan 9, 2019
4030503
fix deduplication for indexed access
gnusi Jan 10, 2019
ece771e
more tests
gnusi Jan 10, 2019
6ebe204
partially address review comments
gnusi Jan 10, 2019
6772e87
address review comments
gnusi Jan 10, 2019
99779ce
simplify code
gnusi Jan 10, 2019
bb0d969
remove irrelevant, commented out code
gnusi Jan 10, 2019
b8ccf1b
merge
gnusi Jan 10, 2019 10000
f3af469
ensure array comparisons are properly handled
gnusi Jan 10, 2019
886f19f
update changelog & loki
gnusi Jan 10, 2019
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
Prev Previous commit
Next Next commit
do not apply handleViewsRule to queries without views
  • Loading branch information
gnusi committed Dec 24, 2018
commit 104c9db255d1af2510363daecf8afbefe559866b
26 changes: 17 additions & 9 deletions arangod/IResearch/IResearchViewOptimizerRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,20 @@ class IResearchViewConditionHandler final
}; // IResearchViewConditionFinder

bool IResearchViewConditionHandler::before(ExecutionNode* en) {
switch (en->getType()) {
case EN::LIMIT:
break;
TRI_ASSERT(_plan && _plan->getAst() && _plan->getAst()->query());
auto& query = *_plan->getAst()->query();

if (_processedViewNodes->size() >= query.views().size()) {
// all views were processed
return false;
}

switch (en->getType()) {
case EN::SINGLETON:
case EN::NORESULTS:
// in all these cases we better abort
return true;

case EN::SORT: {
break;
}

case EN::CALCULATION: {
auto* calcNode = EN::castTo<CalculationNode*>(en);
TRI_ASSERT(calcNode);
Expand All @@ -142,8 +143,7 @@ bool IResearchViewConditionHandler::before(ExecutionNode* en) {
auto& view = *node->view();

// add view and linked collections to the query
TRI_ASSERT(_plan && _plan->getAst() && _plan->getAst()->query());
if (!addView(view, *_plan->getAst()->query())) {
if (!addView(view, query)) {
THROW_ARANGO_EXCEPTION_MESSAGE(
TRI_ERROR_QUERY_PARSE,
"failed to process all collections linked with the view '" + view.name() + "'"
Expand Down Expand Up @@ -245,6 +245,14 @@ void handleViewsRule(
std::unique_ptr<arangodb::aql::ExecutionPlan> plan,
arangodb::aql::OptimizerRule const* rule
) {
TRI_ASSERT(plan && plan->getAst() && plan->getAst()->query());

if (plan->getAst()->query()->views().empty()) {
// nothing to do in absence of views
opt->addPlan(std::move(plan), rule, false);
return;
}

SmallVector<ExecutionNode*>::allocator_type::arena_type a;
SmallVector<ExecutionNode*> nodes{a};

Expand Down
0