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

Skip validation for stored geometry if a 2dsphere index exists

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.7
    • 2.7.6
    • 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

        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: