[SERVER-2134] indexed geo search slower than index-less naive search Created: 22/Nov/10  Updated: 12/Jul/16  Resolved: 04/Apr/11

Status: Closed
Project: Core Server
Component/s: Geo, Index Maintenance, Performance
Affects Version/s: 1.7.3
Fix Version/s: 1.9.0

Type: Improvement Priority: Major - P3
Reporter: Brandon Heller Assignee: Greg Studer
Resolution: Done Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Same issue seen w/1.6.4 on Linux 64 and on 1.7.3 w/ OS X 64bit.


Attachments: File db_geo_slow.tgz    
Participants:

 Description   

I would like to do geo queries against a collection with 1M docs or
more. I'm seeing terrible performance for geo queries, even though
the outputs from find() commands and getIndexes() indicate that a 2d
geo index is being used for the query.

At large sizes (1M), an indexed geo query is slower than a naive javascript search. At 100K commits, the geo search is faster.

More details on the mongodb-user list thread at:

http://groups.google.com/group/mongodb-user/browse_thread/thread/7bcce8a4d58c44c3

Full data from mongodump on the db is attached (compressed).



 Comments   
Comment by auto [ 04/Apr/11 ]

Author:

{u'login': u'gregstuder', u'name': u'gregs', u'email': u'greg@10gen.com'}

Message: better $within performance on large 2d queries SERVER-2134

incremental expansion on both center and neighbor boxes for geo-searching
Branch: master
https://github.com/mongodb/mongo/commit/b994faa86717f780fe8e88e67dbbe49ba455b01d

Comment by Greg Studer [ 29/Mar/11 ]

Still need to perform the same checks on box-neighbors.

Comment by auto [ 29/Mar/11 ]

Author:

{u'login': u'gregstuder', u'name': u'gregs', u'email': u'greg@10gen.com'}

Message: avoid box expand performance cliff with clustered points SERVER-2134
https://github.com/mongodb/mongo/commit/e9dc703b9716204abf288c213cfdf3a5848832c5

Comment by Greg Studer [ 29/Mar/11 ]

Issue is the box-expand algorithm of geo-queries tries to buffer all points contained in the new box expansion. When points are highly clustered, there can be a box expand "cliff" where a new box expansion contains most/all of the points, and they are all checked/stored at once. Solution is to buffer only a limited number of points each time we run out, and expand again only when we need more points.

Same issues would/do hold for $within $center queries.

Generated at Thu Feb 08 02:59:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.