搜索重复的大型地理空间数据库
我正在 MySQL 中使用 maxmind geocities 表(参见此处) (视窗)。
该表有超过 270 万行(非常大)。
我正在尝试按照经度和纬度查找城市重复项(以便找到每个城市的不同拼写,例如 pekin (fr)、beijing...)。
即使我使用左外连接、子请求或复杂的 where 子句,但响应时间太长(永远不会结束)。
这是我的最后一次尝试:
select *
from cities c1, cities c2
where c2.longitude=c1.longitude
and c2.latitude=c1.latitude
and c2.cities!=c1.cities
有人有想法吗?
I'm working with maxmind geocities table (see here), in MySQL (Windows).
This table has more than 2.7 millions lines (so pretty large).
I'm trying to find cities duplicates (in order to find the different spelling for each cities like pekin (fr), beijing...) following their longitude and latitude.
Even if I use left outer join, a subrequest or a complex where clause, but the response time is too long (it never ends).
Here is my last try:
select *
from cities c1, cities c2
where c2.longitude=c1.longitude
and c2.latitude=c1.latitude
and c2.cities!=c1.cities
Does anybody has an idea.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过不选择
*
(我认为cities
就足够了)并在cities(longitude,latitude)
上添加索引来加快查询速度,甚至在城市(经度、纬度、城市)
上。你也可以尝试You can speed up your query by not selecting
*
(I thinkcities
is enough) and adding index oncities(longtitude,latitude)
or even oncities(longtitude,latitude, cities)
. You can also try