Alaa
Alaa

Reputation: 4611

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

Upvotes: 1

Views: 877

Answers (1)

Quassnoi
Quassnoi

Reputation: 425371

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

Could you change its datatype to INT?

Upvotes: 1

Related Questions