Would deleting old data from my tables improve MySQL query performance?

  • When my queries use indexes?
  • When my queries don't use indexes?
  • When I use InnoDB?
  • When I use MyISAM?
link|improve this question
feedback

2 Answers

Maybe. It depends on many things, not all of them related to the factors you've listed above, including how many rows/much data you will be deleting and how much of your total data that represents, how normalized your data is and how many joins your queries perform, how well your queries are written, and probably several other factors.

EDIT: As an aside, it's better to scale to meet the data you have (e.g., by optimizing queries, adding or modifying indexes, upgrading hardware, etc.) than to scale back the data to meet the limitations of your system. There are exceptions, such as if the data you're deleting is itself a potential liability, like personal, financial, or health data that you are certain you have no further legitimate use for.

link|improve this answer
Nice answer. +1 for the edit. – Randolph West Oct 3 '10 at 9:37
nice aside. that is a great attitude. – simonw Oct 4 '10 at 21:52
feedback

After you delete old data, don't forget to optimize tables. (optimize table table_name;)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.