Commit 30066b43 by mic

feat: add new sql.

parent 3608fdc8
alter table t_ip2location_info alter table t_ip2location_info
...@@ -9,3 +9,12 @@ create index idx_business_id ...@@ -9,3 +9,12 @@ create index idx_business_id
alter table t_device alter table t_device
add device_address_update_time datetime null comment '设备地址(country/province/city)上次更新时间' after city; add device_address_update_time datetime null comment '设备地址(country/province/city)上次更新时间' after city;
-- 创建复合索引用于地理位置三级筛选
ALTER TABLE t_device
ADD INDEX idx_device_location(country, province, city);
-- 单独按省份查询的需求
ALTER TABLE t_device ADD INDEX idx_province(province);
-- 单独按城市查询的需求
ALTER TABLE t_device ADD INDEX idx_city(city);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment