My hosting company recommends I purge or clear tables that are massive... They say that performance issues can occur when tables exceed 1 million rows... They gave me a list of these tables for me to go over that are problematic which is helpful but I don't know how to begin to purge or clear without destroying data I need. I KNOW there is old useless data in some of these tables, could even stem back years of quiz attempts... but how do I keep lets say the past 6 months of quiz attempts and purge or clear older than 6 months??? Thanks for any advice here.
| DB | TableName | Rows |
+-----------------------+--------------------------------+---------+
| coldlady_sprucemoodle | mdl_question_attempt_step_data | 5368330 |
| coldlady_dev | mdl_question_attempt_step_data | 4832450 |
| coldlady_sprucemoodle | mdl_question_attempt_steps | 4129807 |
| coldlady_dev | mdl_question_attempt_steps | 3694527 |
| coldlady_sprucemoodle | mdl_question_attempts | 1445599 |
| coldlady_dev | mdl_question_attempts | 1213101 |
| coldlady_sprucemoodle | mdl_logstore_standard_log | 204139 |
| coldlady_sprucemoodle | mdl_grade_grades_history | 143741 |
| coldlady_dev | mdl_grade_grades_history | 121975 |
| coldlady_dev | mdl_logstore_standard_log | 110316 |
+-----------------------+--------------------------------+---------+
+-----------------------+--------------------------------+---------+-------------+
| DB | TableName | Rows | SizeInBytes |
+-----------------------+--------------------------------+---------+-------------+
| coldlady_sprucemoodle | mdl_question_attempts | 1416783 | 721420288 |
| coldlady_dev | mdl_question_attempts | 1246798 | 554696704 |
| coldlady_sprucemoodle | mdl_question_attempt_steps | 4088727 | 317587456 |
| coldlady_sprucemoodle | mdl_question_attempt_step_data | 5301588 | 292405248 |
| coldlady_dev | mdl_question_attempt_steps | 3692386 | 281903104 |
| coldlady_dev | mdl_question_attempt_step_data | 4793823 | 267206656 |
| coldlady_sprucemoodle | mdl_message | 7475 | 47284224 |
| coldlady_sprucemoodle | mdl_logstore_standard_log | 219551 | 45694976 |
| coldlady_sprucemoodle | mdl_grade_grades_history | 146691 | 26804224 |
| coldlady_dev | mdl_logstore_standard_log | 95298 | 23658496 |
+-----------------------+--------------------------------+---------+-------------+