-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GeoQueries seems to be slow #1408
Comments
Hello there, and welcome! The geo-part of the queries isn't implemented by the broker itself, but by mongodb, which is the DB that Orion/Orion-LD use. FYI: for geo-queries to even be able to use the "near" georel, the broker MUST create an index for the attribute (in this case the field is "attrs.location"), so, that is not the problem. Mongo would give an error if the index was missing. Now, if you are interested in contributing (would be the first one in six years ...:)), I'm more than happy to meet and explain what you need to know. I'll add comments to this issue once I know more about the performance issue you've detected. Lastly, thanks for reporting! |
I just thought of one thing you can try. |
So, I created a functest doing this:
I timed the query and got this result:
This is how my entities look:
1000 of those (xxx goinf from 1 to 1000 in "id").
This is the query:
And, well, 64 milliseconds seems like a reasonable query time. So, I'm not able to reproduce the slow geo-queries. Also, I did not use the "-idIndex" CLI param for the broker. |
(I reran with maxDistance==2000 and the query took 72ms, so, still nowhere close to what you see) |
After deploying the docker on Amazon AWS seems like it takes only couple of milliseconds to get a response. I guess I had some limitation from my docker setup or something else. The issue was not the broker. Thanks for your help ! |
ok! |
First of all congratulations for this amazing project! I was recently started looking at the source code and looking forward to contribute!
So I came up to this issue :
I have about 1000 entities with the location attribute (GeoJson)
When doing a geospatial query:
/entities?georel=near;maxDistance==2000&geometry=point&coordinates=[-2.35, 40.78]
It seems to be very slow, and it takes 3 seconds to get a response.
Is this normal ?
The text was updated successfully, but these errors were encountered: