If exported current database as an SQL file size is over 600Mb. Most of which are logs. My question is can cleaning up logs from the database be a good practice to speed up a Magento website?
Magento maintains several tables for logging.These tables log things such as customer and visitor accesses and which products have been compared and which are viewed.Magento has a mechanism for cleaning these logs regularly, but unfortunately this feature is disabled by default and most customers do not turn it on.Please follow the steps to clean out the log tables
Open the database in phpMyAdmin via Control Panel.
In the right frame, select the check box for the following tables:
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
At the bottom of the page, click the drop-down box With Selected and select Empty.
A confirmation screen will appear. Click Yes. This will truncate all of 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.
If you don't need the data at all, you can think about changing the database engine from InnoDB to BLACKHOLE.
I can't see any issues with it, I have been doing this for the past few years with no problems, also you can turn the log cleaning via cron job
SET foreign_key_checks = 0; TRUNCATE mage_core_cache; TRUNCATE mage_core_cache_option; TRUNCATE mage_core_cache_tag; TRUNCATE mage_core_session; TRUNCATE mage_dataflow_batch_export; TRUNCATE mage_dataflow_batch_import; TRUNCATE mage_log_customer; TRUNCATE mage_log_quote; TRUNCATE mage_log_summary; TRUNCATE mage_log_summary_type; TRUNCATE mage_log_url; TRUNCATE mage_log_url_info; TRUNCATE mage_log_visitor; TRUNCATE mage_log_visitor_info; TRUNCATE mage_log_visitor_online; TRUNCATE mage_report_viewed_product_index; TRUNCATE mage_report_compared_product_index; TRUNCATE mage_report_event; TRUNCATE mage_index_event; TRUNCATE mage_index_process_event; TRUNCATE mage_catalog_compare_item; SET foreign_key_checks = 1;
Sure you can remove mage_ if you don't have it in you table name or replace it with whatever you have.