views:

53

answers:

1

I'm doing a where in box query on a collection of ~40K documents. The query takes ~0.3s and fetching documents takes ~0.6 seconds (there are ~10K documents in the result set).

The documents are fairly small (~100 bytes each) and I limit the result to return the lat/lon only.

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

A: 

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

I don't know much about MongoDB, but are you certain that the geospatial index is actually turned on? (I ask because in RDBMSs it's easy to define a table with geometrical/geographical columns yet not define the actual indexing appropriately, and so you get roughly the same performance as what you describe).

Assaf Lavie