Magento Database Optimization and log cleaning Functionality

Magento is heavy on web servers because of its vast and secured modular structure. An eCommerce system must have powerful tracking system which can track customer activities and orders and other relevant data tracking and Magento have all this functional and storing every information in MySQL different database tables in form of logs. Magento have around 10 logs tables which needs to be optimized periodically.

10 Log tables are:
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

To Magento database log cleaning and optimizing through admin panel step by step:

STEP 1: Login in to admin Panel.
STEP 2: Go to system->configurations.
STEp 3: Go to left side tab “system”(Under advanced).
STEP 4: GO to right content Log Cleaning.
STEP 5: Enable it.
STEP 6: Donot forget to give email id(For notification of any fault during log cleaning process).

Its an automated optimizations.
If you want to do manual optimizations then run below queries.

TRUNCATE log_customer
TRUNCATE log_visitor
TRUNCATE log_visitor_info
TRUNCATE log_url
TRUNCATE log_url_info
TRUNCATE log_quote
TRUNCATE report_viewed_product_index
TRUNCATE report_compared_product_index
TRUNCATE report_event
TRUNCATE catalog_compare_item

Thanks,
Suvankar.

Advertisements