Skip to content

Instantly share code, notes, and snippets.

@oscar-reales-interactiv4
Created August 16, 2013 10:44
Show Gist options
  • Save oscar-reales-interactiv4/6248924 to your computer and use it in GitHub Desktop.
Save oscar-reales-interactiv4/6248924 to your computer and use it in GitHub Desktop.
magento: limpiando quotes antiguas para mantener performance
#PARA CUSTOMERS borrando QUOTES más antiguas de 45 días
#DELETE FROM sales_flat_quote WHERE (NOT ISNULL(customer_id) AND customer_id != 0) AND updated_at < DATE_SUB(Now(), INTERVAL 45 DAY) LIMIT 15000;
SELECT * FROM sales_flat_quote WHERE (NOT ISNULL(customer_id) AND customer_id != 0) AND updated_at < DATE_SUB(Now(), INTERVAL 45 DAY) LIMIT 15000;
#PARA NO CUSTOMERS borrando QUOTES más antiguas de 30 días.
#DELETE FROM sales_flat_quote WHERE (ISNULL(customer_id) || customer_id = 0) AND updated_at < DATE_SUB(Now(), INTERVAL 30 DAY);
SELECT * FROM sales_flat_quote WHERE (ISNULL(customer_id) || customer_id = 0) AND updated_at < DATE_SUB(Now(), INTERVAL 30 DAY) LIMIT 50000;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment