simple_history_contexts table grows indefinitely to a gigantic size
-
The simple_history_contexts table appears to grow indefinitely and isn’t regularly pruned w.r.t. the current log retention period (60 days by default).
It unfortunately doesn’t have a date field, so some slightly more complex SQL would be needed to cross reference the history_id with the id entries in the wp_simple_history table to get the date and decide whether a simple_history_contexts table entry needs removing or not.
Yes, I know the Settings -> Simple History -> Clear log now button will remove all the entries from both the wp_simple_history and wp_simple_history_contexts tables, but a) that is a manual process and b) we would lose (I believe) the last 60 days of log entries doing that.
It should be noted that a busy site we’d been running for a few years with Simple History and had never clicked on “Clear log now” button had managed to accumulate 111 million (!) rows in the wp_simple_history_contexts table and the wp_simple_history_contexts.ibd file was a horrendous 37GB for that single table!
Hence, I’m requesting that new code is added so that the entries older than the current log retention period (60 days by default) are removed from the wp_simple_history_contexts table at the same time that old entries in the wp_simple_history table are removed.
- The topic ‘simple_history_contexts table grows indefinitely to a gigantic size’ is closed to new replies.