22,300
社区成员




ip维表 table_ip
字段有 ip_from,ip_to,city
条数 大概40多万
源表 table_day_log
字段有id,ip
条数大概200万条。
想得到的结果
select t1.id,t1.ip,t1.city from
table_Day_log t1
left jion table_ip t2 on t1.ip >= t2.ip_from and t1.ip <= t2.ip_to
请教怎么提高查询速度,我需要查询整个表,纠结了好几天没弄好。
select t1.id,t1.ip,t2.city from
table_Day_log t1
left jion table_ip t2 on t1.ip between t2.ip_from and t2.ip_to