Me consegui unas tablas con info de geolocalizacion, todo perfecto salvo que al consultar la mas grande, de unos 3 millones de registros, el tiempo a veces llega casi a los 15 segundos en un AMD X4 con 3Gb de RAM!
En promedio, no baja de 1.5 segundos.......que creo que para una consulta es MUCHISIMO!

Para determinar el pais debo obtener la IP, pasarla a formato IPv4 buscarla entre columnas que definen rangos en la tabla CityBlocks y luego con el locId buscar en la tabla CityLocation:
Cita:
Aca las tablasSELECT locId FROM CityBlocks WHERE $ip BETWEEN startIpNum AND endIpNum LIMIT 1
SELECT * FROM CityLocation WHERE locId = $locId LIMIT 1
SELECT * FROM CityLocation WHERE locId = $locId LIMIT 1
Cita:
CREATE TABLE IF NOT EXISTS `cityblocks` (
`startIpNum` bigint(20) NOT NULL,
`endIpNum` bigint(20) NOT NULL,
`locId` bigint(20) NOT NULL,
PRIMARY KEY (`startIpNum`),
UNIQUE KEY `locId` (`startIpNum`,`endIpNum`,`locId`),
KEY `endIpNum` (`endIpNum`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `citylocation` (
`locId` bigint(20) NOT NULL,
`country` varchar(2) NOT NULL,
`region` varchar(2) NOT NULL,
`city` varchar(50) NOT NULL,
`postalCode` varchar(10) NOT NULL,
`latitude` int(11) NOT NULL,
`longitude` int(11) NOT NULL,
`metroCode` int(11) NOT NULL,
`areaCode` int(11) NOT NULL,
PRIMARY KEY (`locId`),
UNIQUE KEY `locId` (`locId`,`country`,`region`,`city`,`postalCode`,`l atitude`,`longitude`,`metroCode`,`areaCode`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
`startIpNum` bigint(20) NOT NULL,
`endIpNum` bigint(20) NOT NULL,
`locId` bigint(20) NOT NULL,
PRIMARY KEY (`startIpNum`),
UNIQUE KEY `locId` (`startIpNum`,`endIpNum`,`locId`),
KEY `endIpNum` (`endIpNum`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `citylocation` (
`locId` bigint(20) NOT NULL,
`country` varchar(2) NOT NULL,
`region` varchar(2) NOT NULL,
`city` varchar(50) NOT NULL,
`postalCode` varchar(10) NOT NULL,
`latitude` int(11) NOT NULL,
`longitude` int(11) NOT NULL,
`metroCode` int(11) NOT NULL,
`areaCode` int(11) NOT NULL,
PRIMARY KEY (`locId`),
UNIQUE KEY `locId` (`locId`,`country`,`region`,`city`,`postalCode`,`l atitude`,`longitude`,`metroCode`,`areaCode`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;