My server has been getting slow periods due to high CPU spikes. Whenever this happens, I run "top" in command line and I see a MySQL process taking up over 300% CPU. So I inspect my MySQL slow log.
Exactly every 15 minutes non stop, the largest table (item_orders) in my database with almost 1 million records is being queried. Is this caused from my server automatically indexing the table? There is nothing in my codebase that involves doing this.
And if it's showing up in my slow log I'm guessing the table needs to be optimized better? Do Laravel attributes get taken into account when querying a table? I can see attributes that should be optimized better as they call other tables. But would a raw query directly in the database involve this?
The exact query that shows is this: SELECT /*!40001 SQL_NO_CACHE */ * FROM item_orders;