开发者

define PK before or after LOAD DATA INFILE

I neet to load >1 billion rows into empty MyISAM table. I'm sure all entries in the file are unique. Is it better to load the data into table with PK defined, or add PK later?

I have got 8GB RAM and SAS disc workstation with 5GB RAM limit to store indexes. There is noticeable slow down (from ~200k 开发者_JAVA技巧entries/s to 10-20k entries/s) when index has to be seek from the disc and not from memory.


Before. If you add a PK afterwards then MySQL will create a temporary table to do so.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜