-1)remove all float column (DONT DO CALCULATION AT DB LAYER)
0) change to innodb(用行级lock,复杂的sql多,反而快)(实验结果不行啊,原因还未知)
1) disable key!!!
2)SELECT HIGH_PRIORITY ...andINSERT LOW_PRIORITY ...
3)exact field size
4)horizontal partitioning
5)Redis
6) memory storge engine table
7)、LOAD DATA INFILE (用 CSV engine 当过渡表?)
8)bulk_insert_buffer_size "To increase performance forMyISAMtables, for both LOAD DATA INFILE and INSERT, enlarge the key cache by increasing the key_buffer_size system variable. See Section 8.11.2, “Tuning Server Parameters”."
在my.cnf中添加如下语句,将insert语句的长度设为最大。
Max_allowed_packet=1M
Net_buffer_length=2k
--------------------------
查看bulk_insert_buffer_size的值。
mysql> SHOW VARIABLES LIKE "%BULK%";
+———————————+—————————————-+
| Variable_name | Value |
+———————————+—————————————-+
| bulk_insert_buffer_size | 8388608 |
10)、可以对myisam表并行插入Concurrent_insert系统变量可以被设置用于修改concurrent-insert处理。该变量默认设置为1。如果concurrent_insert被设置为0,并行插入就被禁用。如果该变量被设置为2,在表的末端可以并行插入,即便该表的某些行已经被删除。
11)、 insert into dealyed
good for many clients only ??
12)、插入之前将表锁定 ( 只针对非事务处理型的表 )
这将提高数据库 性能,因为索引缓冲区只是在所有的插入语句完成后才对磁盘 进行一次刷新。通常情况下,有多少个插入语句就会有多少次索引缓冲区刷新。如果你可以用一个插入语句实现所有行的插入,则无需使用显式锁定语句。
要想更快地对事务型表插入,你应该使用 START TRANSACTION 和 COMMIT 语句,而不是 LOCK TABLES 语句。