I have a log_url table that is close to a million rows. I have run log cleaning but it doesn't seem to put a dent into it (confirmed that the cron is running).

After some investigation, I see that the query to get rows to clean from log_url is this (in Mage_Log_Model_Resource_Log::_cleanUrls()):

FROM `log_url_info` AS `url_info_table`
LEFT JOIN `log_url` AS `url_table`
    ON url_info_table.url_id = url_table.url_id 
WHERE (url_table.url_id IS NULL) LIMIT 100;

The method that calls this does not take into account the number of days you specify in the system config at all.

Can anyone tell me why that's the case for the log_url table only? All of the other log tables will take into account the system config settings. I want to clear this table out but I'm a bit nervous as to what may happen when I do. I understand that it could affect customers compared products history, but I have entries going back to 2012.


You can clear this table, along with the others that I have below

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;
  • You can leave report_* tables for other functionalities, like popular products etc. – gSorry Feb 2 '17 at 12:37

Why don't you restrict the logs to past 3 months or 6 months only then? You can do so by going to Admin > System > Configuration > Advanced > System > Log Cleaning setting.

If you don't need the logs at all, @brentwpeterson gave you all the log tables which should really flush lots of GBs unused data!

  • That's the thing, though: the code doesn't seem to be checking the dates at all for the log_url table only. It's only looking for orphan entries that have no corresponding entries in the log_url_info table. – Laura Jun 5 '14 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.