As its known thing that Magento is heavy on web servers because of its vast and secured modular structure. An eCommerce system must have a robust 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 the form of logs. Magento has around 10 logs tables which need to be optimized periodically.
MySQL database optimization is the best way to organize your website in a better idea which can give a better experience to end user who is visiting and buying from your professionally designed eCommerce website.
Here in this post below, I’ve listed everything related to Magento database log cleaning and optimizing way step by step: It’s always best practice to back up your database before doing database optimization process.
Here are logs tables managed by the Magento system. It can track customer activities, login information, customer products compare, visitor’s information, log URL, recently viewed, etc. There is three way to optimize and log clean:
- Magento Default Log Cleaning Functionality
- Create Log Cleaning PHP script with cron Schedule
- Manually clear tables using phpMyAdmin.
Here are the tables which required optimization in Magento:
Execute below MySQL queries for the log cleaning of Magento database:
Magento Database Optimization and log cleaning via Magento Admin Default Functionality
- Log in to Magento Admin Panel
- Go to System>>Configuration
- From left sidebar click system under the advanced tab
- After clicking on the system menu, you will see a block opened from there select log clearing tab and set “Enable Log clearing ” options to “Yes” and set up your desired log cleaning period automatically.
- After the following step for just click on save config, and you are all set.
Optimize Magento Database using log_cleaning script
You can set manual cron script which can run periodically, mention shell command in it and put this script file in root folder if your Magento and set cron schedule on the web server to run this file for log cleaning.
You can specify your time on the cron so it will run as per your schedule rules:
Here is the command line –
php -f shell/log.php clean
Manually clean your Magento Database Log tables for optimization using phpMyAdmin
If you are going in this way, then make sure that you are aware of database and phpMyAdmin structure as you are going to perform tasks with the database which is heart and soul for any application. Always backup database before doing any cleaning work. You can go to phpMyAdmin via your web hosting cPanel, or you can also access the database via SSH command line.
You need to empty below-listed tables using phpMyAdmin interface where you will have to select a table and from the action dropdown at the bottom of the page select “Empty” and then you will see a confirmation page just press “yes” options, and you are all set.
To know more on optimization process just put your comment on this blog and I’ll provide you answers on it. Please refer this link to get platinum level Magento technical support services.
Feel free to contact us for any Magento Website Optimization services!