[SERVER-79092] Optimize the expression search for parameter reuse during parameterization Created: 19/Jul/23  Updated: 29/Oct/23  Resolved: 07/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Peter Volk Assignee: Henri Nikku
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-79018 Implement MatchExpression hasher Closed
Duplicate
is duplicated by SERVER-79393 Expression parameterization input par... Closed
Related
related to SERVER-62509 Write tests to stress ABT and Bonsai Closed
is related to SERVER-78752 An incorrect plan can be written to t... Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Sprint: QO 2023-09-04, QO 2023-09-18
Participants:

 Description   

Currently the parameter re-use has a complexity of O(n^2), due to the use of find_if on a vector, which works fine for small number of expressions within a query. With an increasing number of Expressions an implementation with a map can be superior compared to the find_if on a vector.

Here we need to implement a hybrid approach to use a vector for small number of expressions and a map for larger number of expressions. To hash an expression the expression hashing function from the boolean simplification project should be used. 



 Comments   
Comment by Githook User [ 07/Sep/23 ]

Author:

{'name': 'henrinikku', 'email': 'henri.nikku@mongodb.com', 'username': 'henrinikku'}

Message: SERVER-79092 Optimize the expression search for parameter reuse during parameterization
Branch: master
https://github.com/mongodb/mongo/commit/7eda4530417d221a76785528306a7cf1a12471a1

Comment by Matt Boros [ 07/Aug/23 ]

We would like this to be scheduled to unblock SERVER-62509

Comment by Matt Boros [ 31/Jul/23 ]

Is the plan to do this after SERVER-79018?

Comment by Matt Boros [ 31/Jul/23 ]

This issue is similar to SERVER-78631. We have a linear search that is fast for small N, but when N > some-threshold we would rather use a map. Whichever ticket is done first should build a generic structure for this. See my comment here for details and a bit of starter code for that structure.

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