I noticed some queries were running quite slow all of the sudden. After running EXPLAIN on them I realized they weren't using the indexes that I created.
I looked further using SHOW开发者_如何转开发 INDEXES and realized that all were disabled except the primary key on the table. I'm certain I didn't disable the indexes manually.
I manually enabled the indexes again using ALTER TABLE table ENABLE KEYS and things are back to normal.
How would they have become disabled in the first place? Under what circumstances are indexes automatically disabled?
I'm pretty sure dump files contain statements to disable indexes temporarily to make insertion faster. If someone was restoring data from a dump and the restore failed, the indexes would remain disabled.
精彩评论