Jump to content

DB cleaning - purge tables?


Recommended Posts

Hi there,

 

I was wondering if anyone can tell me which tables should be "emptied" on a regular basis to keep the DB optimized, like visitor stats, or connections, or carts - and even solved topics in the customer service?

 

Can anyone recommend me which tables to safely purge, and which command lines to use?

 

Thank you in advance for your assistance!

 

Dan

Link to comment
Share on other sites

  • 1 month later...
  • 7 months later...

I was looking how to do this today, and I found it is easiest to truncate the tables that are there for carts and statistics one by one .... if you know which ones they are. This has been my experience on 1.3.7

Please backup your database first

 

EDIT: do not truncate carts if you have any orders - it will remove the history of the items in the order.

Edited by ukmacnut (see edit history)
Link to comment
Share on other sites

On my live site I just truncated statistics tables, so I am OK.

There is some functionality using data recorded in stats tables. For example in 1.5 a non-registered user's referrer is obtained from visits stat table to be used when doing newsletter registration. So I would not recommend manually truncating any table unless you are absolutely sure no other part of the code is using data from those tables. Otherwise you may experience very hard to trace, intermittent problems. The best thing to do would be to open an improvement ticket for PS devs to provide functionality to clear stats on demand/periodically and then lobby for votes. Then the problem will be resolved for everyone.

Link to comment
Share on other sites

Hmmmm. Yes, all optimizations are correct. We've checked the site and it is loading in under 2 seconds. Ironically, even though we are in the USA our server is in the UK :)

 

Marty Shue

 

Just checked again, and yes it is very fast (Wish we could get anywhere near that speed actually)

Link to comment
Share on other sites

@phrasespot - I made the new improvement ticket, it is PSCFI-6808

 

@Carolina Custom Designs - Your website is loading fast for me (I am in the UK also). I like the looks of your cart cleaner module. I need to know if it will work on 1.3 so I will send you a PM.

Link to comment
Share on other sites

@Carolina Custom Designs - Your website is loading fast for me (I am in the UK also). I like the looks of your cart cleaner module. I need to know if it will work on 1.3 so I will send you a PM.

 

Thanks for the feedback on the site speed.

 

I just checked and your message has been received. Someone will reply very soon. Thanks for your interest in our modules.

 

Marty Shue

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...