1
0
Fork 0

added assertions

This commit is contained in:
jsteemann 2019-10-30 13:51:26 +01:00
parent a9a078a22f
commit 9f9b35d685
2 changed files with 15 additions and 3 deletions

View File

@ -292,9 +292,9 @@ struct OptimizerRule {
// entire document to a projection of this document
reduceExtractionToProjectionRule,
// moves filters on collection data into EnumerateCollection to
// moves filters on collection data into EnumerateCollection/Index to
// avoid copying large amounts of unneeded documents
moveFiltersIntoEnumerateCollectionRule,
moveFiltersIntoEnumerateRule,
// parallelizes execution in coordinator-sided GatherNodes
parallelizeGatherRule,
@ -310,6 +310,18 @@ struct OptimizerRule {
spliceSubqueriesRule
};
#ifdef USE_ENTERPRISE
static_assert(clusterOneShardRule < distributeInClusterRule);
static_assert(clusterOneShardRule < smartJoinsRule);
static_assert(clusterOneShardRule < scatterInClusterRule);
// smart joins must come before we move filters around, so the smart-join
// detection code does not need to take the special filters into account
static_assert(smartJoinsRule < moveFiltersIntoEnumerateRule);
#endif
static_assert(scatterInClusterRule < parallelizeGatherRule);
velocypack::StringRef name;
RuleFunction func;
RuleLevel level;

View File

@ -377,7 +377,7 @@ void OptimizerRulesFeature::addRules() {
OptimizerRule::Flags::ClusterOnly));
registerRule("move-filters-into-enumerate", moveFiltersIntoEnumerateRule,
OptimizerRule::moveFiltersIntoEnumerateCollectionRule,
OptimizerRule::moveFiltersIntoEnumerateRule,
OptimizerRule::makeFlags(OptimizerRule::Flags::CanBeDisabled));
registerRule("parallelize-gather", parallelizeGatherRule,