You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 4, 2019. It is now read-only.
The current filterByDistanceFrom can't use an index to speed up the query. Because of the trigonometry functions, every lat-lon pair has to be evaluated to find a possible match.
I think you can help the database by specifying the bounding box too (WHERE (lon > $west_limit AND lon < $east_limit AND lat > $south_limit AND lat < $north_limit) AND ABS([trig stuff here])). A semi-smart database can then use the index to prune out the rows that don't match the first part of the query, and only execute the trig functions for the remaining candidates.
The text was updated successfully, but these errors were encountered:
The current
filterByDistanceFrom
can't use an index to speed up the query. Because of the trigonometry functions, every lat-lon pair has to be evaluated to find a possible match.I think you can help the database by specifying the bounding box too (
WHERE (lon > $west_limit AND lon < $east_limit AND lat > $south_limit AND lat < $north_limit) AND ABS([trig stuff here])
). A semi-smart database can then use the index to prune out the rows that don't match the first part of the query, and only execute the trig functions for the remaining candidates.The text was updated successfully, but these errors were encountered: