diff options
author | Håvard Pettersen <havardpe@yahooinc.com> | 2024-02-23 09:41:04 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@yahooinc.com> | 2024-02-23 12:23:53 +0000 |
commit | fbc08038079b6079fcc12b1f54eba4d59acabe83 (patch) | |
tree | 218e277d83da7794b14ce449066df371ff4fc394 /searchcore/src | |
parent | 10267c6347197b5e9731d0a1e9169d74608178f7 (diff) |
know the in-flow when sorting blueprints
also added the option and tagging mechanic needed to force selected
blueprints to be strict even in a non-strict context as well as
calculating how much time this saves you.
Diffstat (limited to 'searchcore/src')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/matching/query.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp index 5ade0a44b8a..1d7a693b1c9 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp @@ -200,7 +200,8 @@ Query::reserveHandles(const IRequestContext & requestContext, ISearchContext &co void Query::optimize(bool sort_by_cost) { - _blueprint = Blueprint::optimize_and_sort(std::move(_blueprint), true, sort_by_cost); + auto opts = Blueprint::Options::all().sort_by_cost(sort_by_cost); + _blueprint = Blueprint::optimize_and_sort(std::move(_blueprint), true, opts); LOG(debug, "optimized blueprint:\n%s\n", _blueprint->asString().c_str()); } @@ -222,7 +223,8 @@ Query::handle_global_filter(const IRequestContext & requestContext, uint32_t doc } // optimized order may change after accounting for global filter: trace.addEvent(5, "Optimize query execution plan to account for global filter"); - _blueprint = Blueprint::optimize_and_sort(std::move(_blueprint), true, sort_by_cost); + auto opts = Blueprint::Options::all().sort_by_cost(sort_by_cost); + _blueprint = Blueprint::optimize_and_sort(std::move(_blueprint), true, opts); LOG(debug, "blueprint after handle_global_filter:\n%s\n", _blueprint->asString().c_str()); // strictness may change if optimized order changed: fetchPostings(ExecuteInfo::create(true, 1.0, requestContext.getDoom(), requestContext.thread_bundle())); |