要 update 个 3000W 行的大表做数据 migration,怎么操作比较好
資深大佬 : rockyou12 53
数据库是 postgresql,以前经纬度用的单独字段,现在像用 point 类型再加 postgis 做分析。表有优化,相当于做了表分区,现在 sql 是
update t_gps set location = ST_GeomFromText('Point(' || "lont" || ' ' || "lat" || ')', 4326); create index idx_gps_location on t_gps using gist ("location");
但在测试库试了下,真的很慢。一般这种更新方案怎么做比较好?
大佬有話說 (4)