-- Rebuild country for each row. This query will result in high CPU load -- Note: replace "wp_" with your REAL Wordpress table prefix UPDATE wp_slim_stats AS ts, wp_slim_countries AS tc SET ts.country = tc.country_code WHERE tc.ip_from < ts.remote_ip AND ts.remote_ip < tc.ip_to;