From 95f52d59563cf002502e48fc3bb08bd64fb17355 Mon Sep 17 00:00:00 2001 From: HÃ¥vard Pettersen Date: Mon, 3 Jun 2024 18:25:52 +0000 Subject: enumerate blueprint nodes if trace level high enough --- searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp | 3 +++ searchcore/src/vespa/searchcore/proton/matching/query.cpp | 6 ++++++ searchcore/src/vespa/searchcore/proton/matching/query.h | 2 ++ 3 files changed, 11 insertions(+) (limited to 'searchcore/src') diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp index 66648dda8c6..73a812f936f 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.cpp @@ -206,6 +206,9 @@ MatchToolsFactory(QueryLimiter & queryLimiter, _query.extractLocations(_queryEnv.locations()); trace.addEvent(5, "Build query execution plan"); _query.reserveHandles(_requestContext, searchContext, _mdl); + if (trace.getLevel() >= 6) { // will dump blueprint later + _query.enumerate_blueprint_nodes(); + } trace.addEvent(5, "Optimize query execution plan"); bool sort_by_cost = SortBlueprintsByCost::check(_queryEnv.getProperties(), rankSetup.sort_blueprints_by_cost()); double hitRate = std::min(1.0, double(maxNumHits)/double(searchContext.getDocIdLimit())); diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.cpp b/searchcore/src/vespa/searchcore/proton/matching/query.cpp index 70f60ff1c2d..b31451059be 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/query.cpp @@ -197,6 +197,12 @@ Query::reserveHandles(const IRequestContext & requestContext, ISearchContext &co LOG(debug, "original blueprint:\n%s\n", _blueprint->asString().c_str()); } +void +Query::enumerate_blueprint_nodes() noexcept +{ + _blueprint->enumerate(1); +} + void Query::optimize(InFlow in_flow, bool sort_by_cost) { diff --git a/searchcore/src/vespa/searchcore/proton/matching/query.h b/searchcore/src/vespa/searchcore/proton/matching/query.h index 03aea5a0d2d..8d6f84763a3 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/query.h +++ b/searchcore/src/vespa/searchcore/proton/matching/query.h @@ -97,6 +97,8 @@ public: ISearchContext &context, search::fef::MatchDataLayout &mdl); + void enumerate_blueprint_nodes() noexcept; + /** * Optimize the query to be executed. This function should be * called after the reserveHandles function and before the -- cgit v1.2.3