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

Skip validation for stored geometry if a 2dsphere index exists

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.7.6
    • 3.1.7
    • Geo
    • None
    • Fully Compatible

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: