Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-92488

Expand IDHACK eligibility to include {_id: {$eq: <val>}}

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • 200

      Right now, only queries of the form {_id: <val>} are "IDHACK" eligible, whereas {_id: {$eq: <val>}} queries are not, even though the queries are semantically equivalent.

      Both forms of the query can be eligible for the express path, but they use slightly different code paths. Making this code change would bring those code paths in line. Also, there are still some cases where we rely on IDHACK rather than the express path (for slightly more complex queries). So this change would expand the set of queries eligible for a fast path in that scenario.

      In terms of code changes, isIdHackEligibleQueryWithoutCollator() should be made to support the second form. We will also need to follow up to see if there are assumptions about the query text/shape in IDHACK code that need to be relaxed.

            Assignee:
            militsa.sotirova@mongodb.com Militsa Sotirova
            Reporter:
            hana.pearlman@mongodb.com Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: