aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-11-28 17:05:42 +0100
committerGitHub <noreply@github.com>2023-11-28 17:05:42 +0100
commit6359834bc232523a4d8686e16f411fa148a649c2 (patch)
treef5a34c257ee1428d8916889c4272e0b8c018535d /searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
parentd4f030fca74bb4795a993b30716c0a1ce68f6bfe (diff)
parent86e70f14ce88fb8f7a4e7889d2309bc13337d02e (diff)
Merge pull request #29485 from vespa-engine/havardpe/andnot-and-andnot-collapsingv8.265.12
collapse co-nested and/andnot in first optimize pass
Diffstat (limited to 'searchlib/src/vespa/searchlib/queryeval/blueprint.cpp')
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/blueprint.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
index a8e2e77623f..639805e116e 100644
--- a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
@@ -36,8 +36,8 @@ void maybe_eliminate_self(Blueprint* &self, Blueprint::UP replacement) {
self->setSourceId(discard->getSourceId());
discard->setParent(nullptr);
}
- // replace with empty blueprint if empty
- if (self->getState().estimate().empty) {
+ // replace with empty blueprint if empty, skip if already empty blueprint
+ if ((self->as_empty() == nullptr) && self->getState().estimate().empty) {
Blueprint::UP discard(self);
self = new EmptyBlueprint(discard->getState().fields());
self->setParent(discard->getParent());
@@ -130,7 +130,6 @@ Blueprint::UP
Blueprint::optimize(Blueprint::UP bp) {
Blueprint *root = bp.release();
root->optimize(root, OptimizePass::FIRST);
- root->optimize(root, OptimizePass::SECOND);
root->optimize(root, OptimizePass::LAST);
return Blueprint::UP(root);
}