I have this simple query:
INSERT IGNORE INTO beststat (bestid,period,rawView) VALUES ( 4510724 , 201205 , 1 )
In the table:
CREATE TABLE `beststat` ( `bestid` int(11) unsigned NOT NULL, `period` mediumint(8) unsigned NOT NULL, `view` mediumint(8) unsigned NOT NULL DEFAULT '0', `rawView` mediumint(8) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`bestid`,`period`), ) ENGINE=InnoDB AUTO_INCREMENT=2020577 DEFAULT CHARSET=utf8
And it takes 1 second to complete.
Side note: this does not actually take 1 second. Sometimes this was done even after 0.05 seconds. But often it takes 1 second
This table (beststat) currently has entries of ~ 500,000 and its size: 40 MB . I have 4 GB of RAM and innodb buffer pool size= 104 857 600 , s: Mysql: 5.1.49-3
innodb buffer pool size
This is the only InnoDB table in my database (others are MyISAM)
ANALYZE TABLE beststat shows: OK
ANALYZE TABLE beststat
Maybe something is wrong with InnoDB settings?
, . - autonumber. , , , . bestid period. , .
Innodb . innodb, , , . , . , , . bestid, .
, , , , . , , , . . , . bestid, period primary key . , 1 1 1 bestid . . , , . : 1 1 . . , 33% , .
, , Android, autocorrect innodb inborn. .
3 - . , , , .
InnoDB , ( 1 ), ( ). InnoDB MyISAM /. ( HW, , .)
: , .
:
, , , , .
, , NoSQL.