How to delete old rows from my heavy DB table?

by nonin
5 replies
Hi. Please help me. Here is the screenshot of Stats table that is full with old data:


How can I save my time and delete rows of all the years except 2012?

... even when I choose to show 1000 rows - it gets more than 2400 pages and manually it might take at least 1 day to clean old data



I really appreciate your help,
Helmuts
#delete #delete rows #heavy #heavy table #phpmyadmin #rows #table
  • Profile picture of the author KirkMcD
    delete from stats where `date` < '1-jan-2012'

    This is permanent. Be sure you want to do this.
    {{ DiscussionBoard.errors[6205822].message }}
    • Profile picture of the author nonin
      Originally Posted by KirkMcD View Post

      delete from stats where `date` < '1-jan-2012'

      This is permanent. Be sure you want to do this.
      hi Kirk,

      I am deleting manually rows write now as we speak...

      How can i do it faster?

      ----

      just an update:

      here is a screenshot of Structure tab:
      Signature
      free UK classifieds Outlived.co.uk are back to life from point 0 - www.Outlived.co.uk
      {{ DiscussionBoard.errors[6205963].message }}
  • Profile picture of the author webcosmo
    click on sql, paste the query kirk gave you.

    however if you dont have enough expertise doing it, you better off consult some professional on this.
    {{ DiscussionBoard.errors[6206697].message }}
  • Profile picture of the author nonin
    tx - done!
    Signature
    free UK classifieds Outlived.co.uk are back to life from point 0 - www.Outlived.co.uk
    {{ DiscussionBoard.errors[6206981].message }}
  • Profile picture of the author Fahmzie
    Hey nonin, dont forget to optimize the table and maybe adding some index to certain columns to make your app faster.
    {{ DiscussionBoard.errors[6207259].message }}

Trending Topics