Background: My database is MySQL 5.6. My last update was published June 21st and it was the fourth minor update since that last BSV that included database changes, which were minor i.e., add a column. Around mid July, a user said some data was missing, when in fact, it was just taking around 30 seconds to load vs the normal 3 seconds or so. In review, many indexes were simply gone. It was a bit random, but for a table called PHS, the PHS_RID index was gone from many tables. I restored all missing indexes manually based on the structure in my Dev database and things improved greatly, of course. However, any query on the PHS table performs almost as though there are no indexes, taking around 25 seconds to display (50K records). Since this is a multi-tenant system, all queries to this table include a WHERE clause for the Account ID, so I have focused on that.
Secondly, any save to the Account object is taking a very long time - in some cases, over a minute.
Because this was a spontaneous issue and because it totally looks and behaves like an index problem, that has been my focus. I don't currently believe there are issues with the queries or business rules since nothing had changed and the system was performing normally until the spontaneous event.
I have tried:
- Normal maintenance tasks such as ANALYZE TABLE (to reset statistics) on the PHS table and several others.
- OPTIMIZE TABLE on the PHS table, though this is not really necessary on MySQL INNO tables.
- CHECK TABLE on the PHS and several other tables all returning OK.
- I deleted and re-added the Account_RID index on the PHS table.
I am concerned about the long time to save an account record but can't see how it links to the other issue. Note that I had previously optimized the business rules on that object IAW Aware IM best practices.
Questions:
- Do you think this is about indexes or something else?
- Does it sound like some corruption? If so, what are some good checks?
- Do you have any exploratory questions?
- Is this an area of expertise or experience for you? If so, I am happy to compensate for your help and attention.
Many thanks