SQL优化
大批量插入数据
1.建议主键顺序插入,因为主键无序排列文件插入的时候需要花费大量的时间,下面举有列子
准备两个存放数据内容的sql语句文件(head 为查询文件前面几行数据的命令)
有序数据
无序数据
加载数据到数据库load data local infile ’/xxx/xxx/xxx.log' into tb_name fields terminated by ',' lines terminated by '\n';意思为从本地文件系统xxx路径加载数据到tb_nam
原创
2020-06-14 10:15:39 ·
67 阅读 ·
0 评论