Can I crop the sales_flat_quote table in a Magento database?

I am working on a magento site that has a large number of entries in the following tables:

Mysql grid from phpadmin

I read several threads on this at: http://www.magentocommerce.com/boards/viewthread/67941/

I would like to know if I can safely delete some entries from these tables without exposing the site! many thanks

+7
source share
1 answer

In fact, you can crop the entire table - but you need to make sure that you set the auto-increment identifier to its previous state.

SET FOREIGN_KEY_CHECKS=0; DELETE FROM `sales_flat_quote` WHERE updated_at < DATE_SUB(Now(),INTERVAL 60 DAY) 

However, this is much better for simple truncation records older than X days. Magento should do this automatically as part of clearing the log, but I have never seen it work as expected (from 1.4 CE to 1.10 EE)

Here you can find a more detailed explanation http://www.sonassi.com/knowledge-base/magento-knowledge-base/enourmous-magento-sales_flat_quote-tables/

I would also check your other log tables, as they are likely to keep growing, you can use the same approach with those http://www.sonassi.com/knowledge-base/magento-knowledge-base/speed- up-magento-product-import-export-and-general-via-the-database /

+13
source

All Articles