Database cleaning tool
-
The database can accumulate a large amount of information regarding reactions. In my case, wp_wpreactions_reacted_users contains 490830 rows, and the query took 0.3826 seconds. I would like to be able to clean the database by removing all reactions while preserving the number of reactions for each post. I think this is possible because, when I edit a post, I can add or remove the number of reactions for each emoji. I’d like to have a feature that would group the total number of reactions per emoji for each post and save this information in a single row, thus removing all information regarding react_id, react_date, etc… Here’s an example:
- I initiate the cleaning tool.
- The cleaning tool checks the emojis for each post. Let’s assume we’re analyzing the post with ID “1”.
- The number of reactions for all emojis for the post with ID 1 is extracted.
- All rows with bind_id = 1 are deleted.
- The previously number of reactions we calculated (third step) is saved in a single row.
- The process continues with the next post…
For instance, if the post with ID “1” is visited, we check if there are any old reactions to add to the count (those we removed previously), and then any new reactions are added to the total (the ones added to the database after the cleaning process).
I hope I’ve explained myself clearly. This tool would help reduce query execution times as the number of rows in the table is drastically reduced.”
- The topic ‘Database cleaning tool’ is closed to new replies.