-
Notifications
You must be signed in to change notification settings - Fork 52
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
IpRange.objects.by_ip(ip) generate sequential scans #35
Comments
Unfortunately, queries are suboptimal. There are several possible speedups: http://habrahabr.ru/post/138067/ Currently I have no plans on implementing any of them, however pull requests are highly welcome. I'll be happy to discuss and help adding working solutions. |
FWIW I'm also experiencing really slow query speeds up to 70ms using PostgresSQL 9.3.2. Is there really no way to optimize the queries? |
Found this: http://blog.jcole.us/2007/11/24/on-efficiently-geo-referencing-ips-with-maxmind-geoip-and-mysql-gis/. Do you think this would be feasible to implement? |
@antonagestam , I end up using this library https://github.com/idlesign/pysyge . If you don't need to make relations between you models and geodata, this will be fine. |
@antonagestam There are some, mentioned by me earlier. As for MySQL GIS, I'd rather use db-agnostic solution for django-geoip.
Exactly. |
Might create a fork implementing something using Postgres' GiST if I find the time. |
I'm using
django-geoip==0.3
in production and notice strange behavior of PostgreSQL 9.1, when executing queries:52% of queries generates sequential scans, this leads to long execution time. Currently, I have 15ms in average for those types of queries which is way too long.
I tinkered a bit with you code and reduced the problem to this Stackoverflow question. Do you have thoughts about this issue?
The text was updated successfully, but these errors were encountered: