Monthly Archives: September 2013

Magento Log Cleaning

If certain precaution are not taken on time then magento Database could go extremely large.AS most of the low performance of the website is the Data which is not of used but stored in Database……Clearing these out not only saves disk space but can lead to some dramatic speed improvements as well.As Magento has several tables to store log details. These log tables has contain the customer Visited url, compared products, import & export Data flow table.

Magento has this features to clean these logs, but unfortunately this feature is disabled by default, most of the magento users to don’t turn it on.

There are two  ways to clear the log tables.

We can manually clear these log details by MYSQL Query
Enable Log cleaning from admin and set the cron job for that.

1. Manually Clean directly on Table:

i) Directly run this RAW query which will allow to delete the table

TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
TRUNCATE log_visitor_online;
TRUNCATE report_viewed_product_index;
TRUNCATE report_compared_product_index;
TRUNCATE report_event;
TRUNCATE index_event;

Generally log table works in some of the follwoing functionality

catalog_product_view (products recently viewed box)
sendfriend_product
catalog_product_compare_add_product (recently compared products box and compare box)
checkout_cart_add_product
wishlist_add_product (wishlist box not wishlist itself)
wishlist_share .

2) Enable log cleaning in magento:

1. Go to System > Configuration > Advanced > System > Log Cleaning

by default Enable Log Cleaning is disbale make it enable and set the days so that when cron will run in that time it will delete all your log tables

and boom as excpected

Hope this will help you