1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
jsteemann 2016-09-19 08:59:16 +02:00
commit e245e155a1
5 changed files with 23 additions and 33 deletions

View File

@ -30,11 +30,6 @@ not present, it will be created.
<!-- arangod/Wal/LogfileManager.h -->
@startDocuBlock WalLogfileAllowOversizeEntries
!SUBSECTION Suppress shape information
<!-- arangod/Wal/LogfileManager.h -->
@startDocuBlock WalLogfileSuppressShapeInformation
!SUBSECTION Number of reserve logfiles
<!-- arangod/Wal/LogfileManager.h -->

View File

@ -58,10 +58,6 @@ logfiles:
@startDocuBlock WalLogfileAllowOversizeEntries
<!-- arangod/Wal/LogfileManager.h -->
@startDocuBlock WalLogfileSuppressShapeInformation
When data gets copied from the write-ahead logfiles into the journals or datafiles
of collections, files will be created on the collection level. How big these files
are is determined by the following global configuration value:

View File

@ -1,24 +0,0 @@
@startDocuBlock WalLogfileSuppressShapeInformation
@brief suppress shape information
`--wal.suppress-shape-information`
Setting this variable to *true* will lead to no shape information being
written into the write-ahead logfiles for documents or edges. While this
is
a good optimization for a single server to save memory (and disk space),
it
it will effectively disable using the write-ahead log as a reliable source
for replicating changes to other servers. A master server with this option
set to *true* will not be able to fully reproduce the structure of saved
documents after a collection has been deleted. In case a replication
client
requests a document for which the collection is already deleted, the
master
will return an empty document. Note that this only affects replication and
not normal operation on the master.
**Do not set this variable to *true* on a server that you plan to use as a
replication master**
@endDocuBlock

View File

@ -3762,6 +3762,8 @@ void arangodb::aql::inlineSubqueriesRule(Optimizer* opt,
Variable const* out = subqueryNode->outVariable();
TRI_ASSERT(out != nullptr);
std::unordered_set<Variable const*> varsUsed;
current = n;
// now check where the subquery is used
while (current->hasParent()) {
@ -3836,6 +3838,7 @@ void arangodb::aql::inlineSubqueriesRule(Optimizer* opt,
RedundantCalculationsReplacer finder(replacements);
plan->root()->walk(&finder);
// abort optimization
current = nullptr;
}
}
@ -3843,6 +3846,14 @@ void arangodb::aql::inlineSubqueriesRule(Optimizer* opt,
if (current == nullptr) {
break;
}
varsUsed.clear();
current->getVariablesUsedHere(varsUsed);
if (varsUsed.find(out) != varsUsed.end()) {
// we found another node that uses the subquery variable
// we need to stop the optimization attempts here
break;
}
current = current->getFirstParent();
}

View File

@ -226,6 +226,18 @@ function optimizerRuleCollectionTestSuite () {
var query = "LET x = (FOR doc IN @@cn RETURN doc) FOR doc2 IN x RETURN x";
var result = AQL_EXPLAIN(query, { "@cn" : cn });
assertEqual(-1, result.plan.rules.indexOf(ruleName), query); // no optimization
},
testSpecificPlan4 : function () {
var query = "LET x = (FOR doc IN @@cn RETURN doc) FOR i IN 1..10 FILTER LENGTH(x) FOR y IN x RETURN y";
var result = AQL_EXPLAIN(query, { "@cn" : cn });
assertEqual(-1, result.plan.rules.indexOf(ruleName), query); // no optimization
},
testSpecificPlan5 : function () {
var query = "FOR j IN 1..10 LET x = (FOR doc IN @@cn RETURN doc) FOR i IN 1..10 FILTER LENGTH(x) FOR y IN x RETURN y";
var result = AQL_EXPLAIN(query, { "@cn" : cn });
assertEqual(-1, result.plan.rules.indexOf(ruleName), query); // no optimization
}
};