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

Skip validation for stored geometry if a 2dsphere index exists

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.7
    • Affects Version/s: 2.7.6
    • Component/s: Geo
    • None
    • Fully Compatible

      When parsing a polygon, we always validate the geometries, like checking whether it's self-intersected among other sanity checks. (S2 already has optimizations for this rather than using the naive O(n^2) algorithm). The dependency graph given by CPU profiling shows this validation takes 80% of the running time for polygons with thousands vertices. If there is already an index on the geo field, this validation is guaranteed by the index, so we can skip it for stored geometries.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            siyuan.zhou@mongodb.com Siyuan Zhou
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: