martin
martin

Reputation: 91

Performance issue for distance query

  1. what is the best solution to improve the following distance query in order to improve the performance.

SELECT count(*) FROM place WHERE DISTANCE(lat, lng, 42.0697, -87.7878) < 10

  1. The query always warn the following message if you have large data set around 80k

fetched more than 50000 records: to speed up the execution, create an index or change the query to use an existent index"

  1. create the following index but it's not involved in that query.

place.distance NOTUNIQUE ["lat","lng"] SBTREE

Upvotes: 0

Views: 79

Answers (1)

Alessandro Rota
Alessandro Rota

Reputation: 3570

You can use a spatial index.

You can look the documentation http://orientdb.com/docs/2.1/Spatial-Index.html

Upvotes: 0

Related Questions