Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?
share|improve this question

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.

share|improve this answer
Nice answer. +1 for the edit. – user3914 Oct 3 '10 at 9:37
nice aside. that is a great attitude. – swxxii Oct 4 '10 at 21:52

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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