你是否在使用 MySQL 5.1.7 或更高版本?
如果你想测试事物是否按预期进行,为什么不使用一个测试模式和只有数据样本,这样可以使其运行更快呢?
更新
关于 --use-threads 是否起作用,我不确定有什么明确的方法来检查。但是,我刚刚运行了一些测试,在 ~130M 数据中没有看到任何真正的差异:
mysqlimport --lock-tables --debug-info --use-threads=2 test /tmp/test/*.txt
Records: 2076063 Deleted: 0 Skipped: 0 Warnings: 0
User time 0.02, System time 0.08
Maximum resident set size 3884, Integral resident set size 0
Non-physical pagefaults 737, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 1340, Involuntary context switches 17
----
mysqlimport --lock-tables --debug-info --use-threads=4 test /tmp/test/*.txt
Records: 2076063 Deleted: 0 Skipped: 0 Warnings: 0
User time 0.03, System time 0.09
Maximum resident set size 3884, Integral resident set size 0
Non-physical pagefaults 738, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 1343, Involuntary context switches 41
----
mysqlimport --lock-tables --debug-info --use-threads=8 test /tmp/test/*.txt
Records: 2076063 Deleted: 0 Skipped: 0 Warnings: 0
User time 0.02, System time 0.09
Maximum resident set size 3884, Integral resident set size 0
Non-physical pagefaults 738, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 1341, Involuntary context switches 30
--lock-tables
锁定所有写入表(这将禁用线程)。 - Ommadawn