Skip to content
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

how long should it take for this query to run? #3

Open
simonkassel opened this issue Mar 14, 2017 · 2 comments
Open

how long should it take for this query to run? #3

simonkassel opened this issue Mar 14, 2017 · 2 comments

Comments

@simonkassel
Copy link

I'm running the second query and it's up to 45 minutes. How long is it taking for everyone else?

@galkamax
Copy link
Contributor

@simonkassel There is a trick for speeding it up. If you add a WHERE clause like this, it will only bother calculating the distance for points that are nearby.

WHERE ST_Distance(r.geom, a.geom) < 0.01

It's the spatial index that allows this to work.

@simonkassel
Copy link
Author

This was a gamechanger. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants