Deleting orders is not reducing the size of "cscart_order_data" table in database

Hello to anyone who can help.
Our database is has reached the limit of our host and we need to reduce it. It looks like the culprit is the “order_data” table. I read in a forum post that deleting old orders will reduce it, but it doesn’t seem to be changing the size at all. I’ve deleted thousands of orders and no change in the table or database size.

Is there something else I need to do?

please check also what else is increasing the size of the database, might be logs, products or other add-ons databases

If you require assistance with debugging, please send me a DM, and we’ll be glad to assist you.

If you delete orders with default tools, the cscart_order_data table is cleared

1 Like

Optimize the tables that have overhead.

1 Like


Two SQL queries will help you.

DELETE FROM cscart_order_data WHERE type IN ('G', 'L')
OPTIMIZE TABLE cscart_order_data

Kindly keep in mind that shipping data for relevant orders will also be deleted.
Create the database backup before executing queries.

Thanks so much everyone for your help!

For anyone having similar issue in the future, it turns out I had to “Optimize” the database (option found in the Admin panel) as two people mentioned above, and this seemed to update/reduce the database size accordingly.