Creating this issue to document a rare occurence of slow yet often-executed queries, so far experience on the
option table only. Our
option table usually contains a couple thousands records at most and is therefore very small. Queries on the table take only a few milliseconds. But in some cases they take like 1 min to run, and we couldn't explain it.
Example 1: this query was running for 50 seconds+:
INSERT INTO `option` (option_name, option_value, autoload) VALUES ('version_xyz', '3.0.2', '1') ON DUPLICATE KEY UPDATE option_value = '3.0.2'
Example 2: this other query was running for many seconds as well:
INSERT INTO `option` (option_name, option_value, autoload) VALUES ('LastFullArchivingStartTime', '1514894465', '0') ON DUPLICATE KEY UPDATE option_value = '1514894465'
If anyone has any idea why these queries could be so slow, please leave a comment!