[SERVER-82764] Make "planningTimeMicros" incorporate time from the multi-planner trial period Created: 03/Nov/23  Updated: 30/Jan/24  Resolved: 30/Jan/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc2

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Misha Tyulenev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-82549 MongoDB 7.0.2 SBE query slow when dir... Closed
is related to SERVER-70646 Compute and add query planning time t... Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.3
Sprint: QO 2024-02-05
Participants:

 Description   

The planningTimeMicros metric indicates the time spent by the system in the query optimization phase, and appears in the logs and system.profile output. I believe it was first added in SERVER-70646 for version 6.2.

The current implementation incorporates the time spent enumerating and constructing plan alternatives, but it excludes the time spent in the multi-planner. This multi-planning phase can be quite expensive, since it is where we partially execute various candidate plans in order to gather runtime statistics. Furthermore, we've seen some reports of performance problems recently related to the SBE multi-planning implementation.

In order to make "planningTimeMicros" more useful for detecting performance problems related to multi-planning, we should change the implementation so that this metric incorporates time spent multi-planning. Preferably we would make sure it works this way for both the classic engine and SBE. An additional benefit of this change is that it will make the metric more meaningful to compare apples-to-apples against Bonsai optimization time, since in both cases we will be measuring the total time that the system takes to determine the optimal physical query plan.



 Comments   
Comment by Githook User [ 30/Jan/24 ]

Author:

{'name': 'Misha Tyulenev', 'email': 'misha@mongodb.com', 'username': 'mikety'}

Message: SERVER-82764 incorporate into planningTime time from multiplanner tri… (#18005)

GitOrigin-RevId: 6878b717a3bb6923a21773c051875e46922d9aa5
Branch: master
https://github.com/mongodb/mongo/commit/f4b359531880b0cead2d72dd08a091eece1aa2db

Generated at Thu Feb 08 06:50:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.