ps_cart_rule_combination huge size problem
Here are the steps we worked on this issues for our customer.
1/. Backup the database
2/. import the database into Testing site, better not to touch production one.
3/. found out what kind of discount generated most of the combinat and delete them
SELECT description, count(description) as frequence FROM `ps_cart_rule`
where cart_rule_restriction = 1
group by description
order by frequence DESC
4/. delete from ps_cart_rule_combination where id_cart_rule_1 in (select id_cart_rule from ps_cart_rule where description like 'Birthday%');
- however, if you have a super huge like over 10G, better to Truncate All and disable the compatibility option.
update ps_cart_rule set cart_rule_restriction = 0
- most of the people misunderstood this feature(compatibility). It is no need to enable it if you assume your discount should work with any other discount. Only when you need a specific combination with two discounts.
example: You have 100 discount rules setup in the shop.
1/. customer birthday discount, 10% on specific category.
2/. Buy over $1000 with free shipping.
You still have 98 discount rules setup in the store. However, you just want customer birthday discount + Buy over$1000 free shipping can work together and nothing else.
In this situation, you will use "compatibility" to specifically declare this combination. Otherwise, it is no need to enable it.
3/. You can also disable all the expired discount rule or even delete them all.
update ps_cart_rule set active = 0 where date_to < '2022-01-24'