MongoDB geospatial index: how fast?

I am making a where in box request where in box ~ 40K document collection. The request takes ~ 0.3 s, and the selection of documents takes ~ 0.6 seconds (in the result set there are ~ 10 thousand documents).

The docs are pretty small (~ 100 bytes each), and I limit the result to returning only lat / lon.

It seems very slow. Is this right, or am I doing something wrong?

+4
source share
1 answer

It seems very slow. An example of a roughly equivalent search that I did on PostgreSQL, for example, is too fast to measure (i.e., probably faster than 1 ms).

I don't know much about MongoDB, but are you sure the geospatial index is really included? (I ask, because in an RDBMS it is easy to define a table with geometric / geographical columns, but not to properly determine the actual indexing, and therefore you will get about the same performance as what you describe).

+1
source

All Articles