-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: django
-
None
Context
We currently use $expr queries extensively in our MQL query generation. As $expr queries cannot use indexes for most operations, this has a significant performance impact. Adding a query optimization step to convert simple $expr queries to use the more performant and index-enabled $match operation instead is a worthwhile change.
Definition of done
Add an optimizer to convert simple $expr queries to $match queries without $expr in them. If the $expr query cannot be converted to a $match query, it must be left as the original $expr. This behavior is nested. Currently this should be limited to $eq and $in operations for now, but in the future can be extended to other $expr conversions.
This only affects the querying done for match queries, as the querying for lookups, groupings, or aggregation pipelines are out of scope.
Pitfalls
Performance must be significantly improved with this change.
- related to
-
INTPYTHON-735 Address performance issues with $expr use
-
- Closed
-