Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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. –  simonw 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

 
discard

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.