[SERVER-77181] Implement query settings support in Bonsai Created: 16/May/23  Updated: 14/Nov/23

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Denis Grebennicov Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-52304 Enable feature flag for query settings Backlog
Duplicate
is duplicated by SERVER-78996 Extend persistent query settings to s... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

Based on the current design, query settings will only be supported for queries handled by the multiplanner for both Classic and Nebari engines.

Once Bonsai becomes available it would be great to make them support query settings as well.

The tasks would be:

  • Support the "v3" engine hint. Currently v1 (Classic + Multiplanner) and v2 (Nebari + Multiplanner) are planned to be supported.
  • Support index hints specified using persistent query settings in Bonsai.
  • Ensure that the ‘querySettings’ field in the explain output is present and accurate in CQF explain


 Comments   
Comment by Denis Grebennicov [ 14/Nov/23 ]

I am not sure we should do anything about Bonsai and index filters, since we deprecate index filters in PM-412 and hopefully will remove them in 9.0

Not sure adding support for it is worthy, unless it's trivial.

I would want query settings to add support for forced indexes and then all types of hints would be represented via query settings alone and then there would be no need for handling 3 different types of hints. Maybe this could be done as part of rich hints project :shrug:

Comment by Hana Pearlman [ 14/Nov/23 ]

We'll probably want to do part of the "support index hints specified using persistent query settings in Bonsai" subtask in M2. Specifically, it's possible through query settings to hint a collscan (via {$natural: +1/-1}), which is supported in M2. The same is true for index filters set via planCacheSetFilter, so we'll want to make sure that we're supporting this as well, and correctly handling the hierarchy of index filters, index hints on a query, and index hints from query settings. It may make sense to do this work together here.

Comment by David Storch [ 24/Jul/23 ]

Putting this in the M2 correctness project per discussion in optimizer huddle. We don't actually think we should implement it yet because the persistent query settings project is ongoing, but we also don't want to forget about it.

Also, we should consider splitting this work into two subtasks: one for adding queryEngineVersion:"v3" (we should reopen duplicate ticket SERVER-78996?) and one about making Bonsai respect index hints set using persistent query settings.

Marking as blocked on the "enable feature flag" ticket for the persistent query settings project.

Comment by David Storch [ 14/Jul/23 ]

Per Slack discussion with denis.grebennicov@mongodb.com this is not going to be done as part of the current project, so I'm putting this into the triage queue to find it a new home.

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