How To Clean Up Your Magento Store’s Database Logs For Faster Performance

There are two different options to clean up your logs:

  1. Clean your logs via Magento Admin Panel “Log Cleaning”
  2. Clean up your database tables directly via phpmyadmin or SSH MySQL.

The following tables are used & managed by Magento’s log cleaning functions:
log_customer
log_visitor
log_visitor_info
log_url
log_url_info
log_quote
report_viewed_product_index
report_compared_product_index
report_event
catalog_compare_item

Cleaning Logs via Magento Admin Panel

This method is easier for non technical store owners who don’t want’ to mess directly with the Magento store’s database. To activate log cleaning option in Magento just do the following:

  1. Log on to your Magento Admin Panel.
  2. Go to System => Configuration
  3. On the left under Advanced click on System (Advanced = > System)
  4. Under system you will see “Log Cleaning” option
  5. Fill the desired “Log Cleaning” option values and click Save.

Cleaning Logs via phpMyAdmin

If you are comfortable with mysql and queries then this method is more efficient and quicker than default Magento Log Cleaning tool. This method also allows your to clean whatever you like, you can even clean tables which aren’t included in default Magento’s Log Cleaning tool.

  1. Open the database in phpMyAdmin
  2. In the right frame, click on the boxes for the following tables:
  3. dataflow_batch_export
    dataflow_batch_import
    log_customer
    log_quote
    log_summary
    log_summary_type
    log_url
    log_url_info
    log_visitor
    log_visitor_info
    log_visitor_online
    report_viewed_product_index
    report_compared_product_index
    report_event
  4. Look to the bottom of the page, then click the drop down box that says “with selected” and click empty.
  5. Click Yes on confirmation screen, and this will truncate all the selected tables.

Keep in mind that we are here to empty (Truncate) selected tables are not drop them. Be very careful when you do this.

Performing this regularly will definitely improve your Magento store’s performance and efficiency. You can setup up scripts to do this automatically at regular intervals too using “CRON”.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Magento Shipping Country Codes

Country 2 Digit Code   3 Digit Code  Afghanistan AF   ...