Speed up Magento, product import, export and general via the database

If your Magento product imports and exports certainly aren’t as speedy as they used to be, it could be that the database table is just filling up with old records. There are a few to look at.

magento_space

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;

For your logs – I would suggest you correctly set up log cleaning, this relies on the Magento Cron being correctly set up.

1) Log into your Magento admin and go to System > Configuration
2) Scroll down to Advanced > System
3) Select Log Cleaning
4) Change “save log, days” to a sensible figure, we use 30.
5) Enable log cleaning

Or watch the screencast below.

[SWF]/screencasts/log_cleaning.swf,800,620[/SWF]

  • Pingback: Speed up Magento, product import, export and general via the … | Magento News

  • http://www.oshaoutlet.com Kevin

    If I truncate these 2 tables, I won’t lose anything in the front end? Is this just stored, and has no use after an import or export has been done?

  • https://www.sonassi.com ben@sonassi.com

    There is 6 tables you can truncate. Regarding the dataflow tables, they are only used during import/export – after the process has completed, the data is technically irrelevant.

  • http://www.sqlstudy.com/ Magento建站

    when TRUNCATE index_event;
    error raise:

    Cannot truncate a table referenced in a foreign key constraint (`dev_demo1001`.`index_process_event`, CONSTRAINT `FK_INDEX_EVNT_PROCESS` FOREIGN KEY (`event_id`) REFERENCES `dev_demo1001`.`index_event` (`event_id`))