Mautic some table size is increasing rapidly

Your software
My Mautic version is: 4.3.2
My PHP version is: 7.4.3
My Database type and version is:

Your problem
Hi Team,
I have table callled lead_event_log, its size growing rapidly at present its size reached to 35gb, how to control its size?as my most of records inserted via API batch only, no. of directs import is minimal say 500 record.
There are other log tables also whose size increasing rapidly shown in below, Please guide to over come on this.

Sounds like you need weight control:

We did that delete exercise for tables email_stats,campaign_lead_event_log but what about other table in attached screenshot? in my case at present table lead_event_log is occupied 35 gb. Please suggest.

This table is bloating if you have a lot of imports or maybe a lot of tracking events.
In order to understand better what is happening, plz paste the results here:

select bundle, object, action, count(id) from lead_event_log group by bundle, object, action


Awaiting for your response.

Hi, your problem is, that you have added 1.2 million contacts to your system, and every single contact joined 3 segments and got triggered 4-5 campaigns.

Are you using all the 1.2 million contacts? If so, you just need to invest in a better infracstructure.
If not, then better delete incative contact’s campaign and segment history fro time to time.

Check if the regular cleanup command helps:

If not, then you’ll need some scripts, that delete old entries.

Please do me a favor , At present I can see in the table lead_event_log has around 9cr records, so in order to delete data from lead_event_log table which data do you think is irrelevant can be proceed to delete.

Apart from that I just want to know If we truncate all related to log table then what will happen? Are the all log tables data important ?

This contains the info you see in your contacts view and in reports.
You’ll lose detailed reporting capability. Campaigns won’t be affected.
I’m not sure about checking clicks and url visits, you need to test it. The reference I gave you is a good starting points.

I would just make a backup, truncate the table and see what happens. Worst case you can restore.