1
0
Fork 0

Add routine to normalize conditions without re-running the optimizer.

This commit is contained in:
Wilfried Goesgens 2015-11-25 15:22:11 +01:00
parent c061a3309a
commit a0f9524df8
2 changed files with 33 additions and 0 deletions

View File

@ -568,6 +568,30 @@ void Condition::normalize (ExecutionPlan* plan) {
#endif
}
////////////////////////////////////////////////////////////////////////////////
/// @brief normalize the condition
/// this will convert the condition into its disjunctive normal form
/// in this case we don't re-run the optimizer. Its expected that you
/// don't want to remove eventually unneccessary filters.
////////////////////////////////////////////////////////////////////////////////
void Condition::normalize () {
if (_isNormalized) {
// already normalized
return;
}
_root = transformNode(_root);
_root = fixRoot(_root, 0);
#ifdef TRI_ENABLE_MAINTAINER_MODE
if (_root != nullptr) {
// _root->dump(0);
validateAst(_root, 0);
}
#endif
}
////////////////////////////////////////////////////////////////////////////////
/// @brief removes condition parts from another
////////////////////////////////////////////////////////////////////////////////

View File

@ -310,6 +310,15 @@ namespace triagens {
void normalize (ExecutionPlan*);
////////////////////////////////////////////////////////////////////////////////
/// @brief normalize the condition
/// this will convert the condition into its disjunctive normal form
/// in this case we don't re-run the optimizer. Its expected that you
/// don't want to remove eventually unneccessary filters.
////////////////////////////////////////////////////////////////////////////////
void normalize ();
////////////////////////////////////////////////////////////////////////////////
/// @brief removes condition parts from another
////////////////////////////////////////////////////////////////////////////////