06.07.2015, 16:06
As a matter of fact, I do. I have imported the MaxMind GeoIP database into MySQL, using numerical IP ranges for increased efficiency. Some 100,000 rows. If I need to join that table to retrieve a country code or a CIDR range it sometimes takes a while, depending on the query, even with proper indexing.
For example:
Executes on average in 1.14 seconds. And that's just for the 28 accounts in my local test instance.
For example:
PHP Code:
SELECT a.reg_name, INET_NTOA(a.regip), c.name, i.block FROM account_main a
JOIN list_ipv4 i ON a.regip BETWEEN i.range_start and i.range_end
JOIN list_countries c ON i.country_code = c.code