现在有一个客户表,location字段用于记录客户的经纬度坐标,例如:
create table customer(
id int primary key auto_increment,
location GEOMETRY,
name varchar(256)
)
为了查询性能优化,需要给location字段加上 索引,该如何添加?
MySQL中对于经纬度字段如何添加索引提高性能
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
人在江湖飘ya飘 2022-12-02 22:04关注alter table customer modify location GEOMETRY not null; alter table customer add INDEX geo_index(location);本回答被题主选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 1无用