kakuilan / china_area_mysql

中国5级行政区域mysql库
5.18k stars 1.22k forks source link

查询很费时阿? #44

Closed sapceman closed 5 years ago

sapceman commented 5 years ago

PHP查询语句:SELECT id,level,name,short_name,merger_name,pinyin,lng,lat FROM map_cnarea_2018 WHERE short_name='$query' ORDER BY level 耗时5秒多,通过分析,Creating Sort Index 耗时就5秒。请问大神,如何解决?

kakuilan commented 5 years ago

你自己创建相应的索引就行

sapceman commented 5 years ago

加了索引,问题解决了。