So I have two very very small tables (~20 rows) that are hit very frequently and pop up in the slowlog (I'm also logging tables not using indexes).
I tested using a large multipart index (that's just all the columns being selected) on this query:
SELECT type_templates.name, type_templates.is_default, type_templates.created_at, type_templates.updated_at, type_templates.id FROM type_templates;
However the query is still being logged (the QEP in this case shows an index hit):
+----+-------------+----------------+-------+---------------+------------------+---------+------+------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+----------------+-------+---------------+------------------+---------+------+------+----------+-------------+
| 1 | SIMPLE | type_templates | index | NULL | idx_typetmpl_mp1 | 785 | NULL | 13 | 100.00 | Using index |
+----+-------------+----------------+-------+---------------+------------------+---------+------+------+----------+-------------+
Now, I understand 100% that the sequential scan is probably faster, but I think the problem I'm having is... why in the world are these being logged?
logging tables not using indexes
is too noisy to turn on.