Re: How can I optimize this query?
I don't know if this might help, but I came up with a query to find a single IP address that is orders of magnitude faster than using the between syntax.
SELECT cl.country,cl.region,cl.city
FROM geoipdb.CityLocation cl
JOIN geoipdb.CityBlocks cb
ON (cl.locId=cb.locId)
WHERE cb.endIpNum >= $longipnum
ORDER BY cb.endIpNum LIMIT 1;
Using the between method takes 0.7 seconds to get a single ip and this one takes 0.0007 seconds.
Subject
Views
Written By
Posted
5310
March 12, 2010 02:40PM
2341
March 13, 2010 04:07PM
1769
March 13, 2010 04:17PM
1932
March 16, 2010 08:22AM
2400
April 14, 2010 02:27AM
1933
March 16, 2010 07:58AM
1848
March 16, 2010 08:16AM
1848
March 16, 2010 08:21AM
1813
March 16, 2010 08:16AM
Re: How can I optimize this query?
1833
March 16, 2010 09:40AM
1866
March 16, 2010 01:59PM
1868
March 27, 2010 03:36PM
1630
April 14, 2010 07:21AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.