Shopify Log deletion Approach

Hi Team,

Our databases sizes are growing rapidly (Close to 100MB every month) and we find that substantial size is taken by the Shopify Log.

We don’t require the Shopify Log which are more than a 2 weeks old. Hence we are planning to deleting the same.

When we use the frappe.delete_doc() it is taking lot of time and some times the terminal where the delete command is run becomes unresponsive. Hence deletion is not completed properly.

if we try to delete using the raw SQL Query, it is getting deleted rapidly.

Would like to know if there are any side effects or impacts of deleting it using Raw Query over delete_doc()?

How to use delete_doc() in delete very large number of records?

Thanks,
Saravana

Running raw queries is usually not safe, but Shopify logs are just logs and can be safely removed.

Option to auto-delete old successful logs is in the backlog: General - Clean up old logs · Issue #61 · frappe/ecommerce_integrations · GitHub

@ankush. Thanks for the response. Any approach to delete large number of records (90,000) shopify log using delete_doc?(). Terminal becoming unresponsive