So, I have a table that is used mainly as a NoSQL installation. Structure:
id bigint primary key data mediumblob modified timestamp
It has about 350 thousand lines. The queries performed on it are structured as follows:
select data from the table where id = XXX;
The table engine is InnoDB. I notice that sometimes queries against this table are pretty slow. Sometimes they need 3 seconds. The table is 3 GB on disk, and I gave innodb_buffer_pool_size 4G.
Is there something I'm missing here? Are there any settings that I can tune to improve performance?
Edit: on request, explain the output:
+----+-------------+----------+-------+---------------+---------+---------+-------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+----------+-------+---------------+---------+---------+-------+------+-------+ | 1 | SIMPLE | cache | const | PRIMARY | PRIMARY | 8 | const | 1 | | +----+-------------+----------+-------+---------------+---------+---------+-------+------+-------+
create table:
CREATE TABLE `cache` ( `id` bigint(20) unsigned NOT NULL DEFAULT '0', `data` mediumblob, `modified` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8
source share