Convert simple $expr queries to $match queries

XMLWordPrintableJSON

    • 🔵 Done
    • Python Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • 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.

            Assignee:
            Noah Stapp
            Reporter:
            Noah Stapp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: