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

Optimize $geoNear minDistance bounds on time-series metrics

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization

      After SERVER-58602, a $geoNear stage operating on time-series measurement field is implemented as separate stages for the filtering, projection, and sort. The 'maxDistance' argument becomes a $geoWithin predicate, which can generate index bounds when a 2d or 2dsphere index is available.

      We could do something similar for 'minDistance'. A few ideas are:

      • For a spherical query, create an "inside-out" $geoWithin: center it around an antipodal point, with a radius of pi - minDistance.
      • For a flat query, create a negated $geoWithin. Use a slightly smaller radius, perhaps (minDistance * (1 - epsilon)), to avoid excluding points exactly minDistance from the query.
      • Introduce a new shape operator, similar to $center and $centerSphere but with a minDistance argument in addition to maxDistance.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.percy@mongodb.com David Percy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: