[SERVER-15204] Skip validation for stored geometry if a 2dsphere index exists Created: 10/Sep/14 Updated: 08/Sep/21 Resolved: 06/Aug/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Geo |
| Affects Version/s: | 2.7.6 |
| Fix Version/s: | 3.1.7 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Siyuan Zhou | Assignee: | Kevin Albertson |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Participants: | |||||||||||||||||
| 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. |
| Comments |
| Comment by Githook User [ 05/Aug/15 ] |
|
Author: {u'username': u'kevinAlbs', u'name': u'Kevin Albertson', u'email': u'kevin.albertson@10gen.com'}Message: |
| Comment by Siyuan Zhou [ 25/Sep/14 ] |
|
aplimovil - Sorry for the confusion. This issue only affects users who store polygons. I mentioned this ticket in |
| Comment by Abraham Lopez [ 25/Sep/14 ] |
|
I'm confused then. How's this ticket related to the |
| Comment by Siyuan Zhou [ 24/Sep/14 ] |
|
aplimovil, please allow me to clarify this issue. I believe this is a separate issue from Siyuan, |
| Comment by Abraham Lopez [ 24/Sep/14 ] |
|
This issue causes $near/$nearSphere to be very slow when using 2DSphere indexes, as filed in Please update the aforementioned ticket when this is tackled, so we can confirm the fix with the original test scenario. Thanks. |