• Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This will avoid repeatedly recomputing narrowType() in some cases. A quick prototype demonstrated ~3x improvements in `BM_CanPathBeArray` and  ~3x-11x improvements in `BM_CanPathBeArrayDottedPath`.

       

      Note that we may not want to do this as it might get complicated with the optimization proposed in SERVER-138067 (the cache can't just be a map from StageId to a top-level Type if some paths were not narrowed for that type).

       

      One alternative approach could be to have the cache be a map (String, StageId) -> Type, where String is the exact queried path and StageId is the latest narrowing stage. The cache would not match subpaths, path prefixes etc, but it would be straightforward to maintain and compatible with SERVER-138067.

            Assignee:
            Unassigned
            Reporter:
            Henri Nikku
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: