开发者

mysql innodb insert statement takes very long time

i have innodb tables (all of them are in the same file, and this file became very large, about 8GB) when i insert a row in one this table (this table contains about 1 million record), this insert statement takes about 30 seconds !!! is there anyway to improve this issue?? any idea is highly appreciated

CREATE TABLE userdata ( userno blob NOT NULL, amount double(11,2), active enum('0','1') default '0', used enum('0','1') default '0', ActionTime timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, Bonus enum('0','1') default '0', UserType enum('Perm','Temp') NOT NULL default 'Perm', serial_number bigint(20) NOT NULL default '0', PRIMARY KEY (userno(50)), KEY AIX (active), KEY UIX (used), KEY Id (userno(20),active), KEY UI (userno(50))开发者_运维知识库, KEY SNI (serial_number) ) ENGINE=InnoDB DEFAULT CHARSET=latin1


Having BLOB as a PRIMARY KEY is not the best idea.

Could you change its datatype to INT?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜