# Mautic some table size is increasing rapidly

**URL:** <https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [October 25, 2022, 11:39am UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823 "2022-10-25T11:39:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shyamalm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shyamalm/32/1394_2.png) [@shyamalm](https://forum.mautic.org/u/shyamalm)\
**Post date:** [October 25, 2022, 11:39am UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823/1 "2022-10-25T11:39:47Z")

</div>

**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.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/f93b7be5cbb1aa5fae301d69bb36aed27d0343e7.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [October 25, 2022, 12:05pm UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823/2 "2022-10-25T12:05:13Z")

</div>

Sounds like you need weight control:

> **[The great Mautic weight control – Joey Keller](https://joeykeller.com/the-great-mautic-weight-control/)**

---

<div class="post-metadata">

**Author:** ![shyamalm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shyamalm/32/1394_2.png) [@shyamalm](https://forum.mautic.org/u/shyamalm)\
**Post date:** [October 25, 2022, 12:52pm UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823/3 "2022-10-25T12:52:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [October 25, 2022, 1:01pm UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823/4 "2022-10-25T13:01:11Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![shyamalm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shyamalm/32/1394_2.png) [@shyamalm](https://forum.mautic.org/u/shyamalm)\
**Post date:** [October 27, 2022, 4:12am UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823/5 "2022-10-27T04:12:53Z")

</div>

> [@joeyk](#):
>
> select bundle, object, action, count(id) from lead\_event\_log group by bundle, object, action

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9baf8b89ae6b198d19d90780a95820ea0355d571.png)

---

<div class="post-metadata">

**Author:** ![shyamalm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shyamalm/32/1394_2.png) [@shyamalm](https://forum.mautic.org/u/shyamalm)\
**Post date:** [October 28, 2022, 3:26am UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823/6 "2022-10-28T03:26:39Z")

</div>

Awaiting for your response.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [October 28, 2022, 11:53am UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823/7 "2022-10-28T11:53:01Z")

</div>

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:

> [@Mautic database is huge, can I manually delete old records?](https://forum.mautic.org/t/mautic-database-is-huge-can-i-manually-delete-old-records/22646/4):
>
> @instamaker There is a cronjob which you can add which purges data older than X days. It might make sense if you run this command to keep the database at a decent level. View the docs here, look for Clean up old data M

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

---

<div class="post-metadata">

**Author:** ![shyamalm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shyamalm/32/1394_2.png) [@shyamalm](https://forum.mautic.org/u/shyamalm)\
**Post date:** [October 29, 2022, 4:44am UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823/8 "2022-10-29T04:44:19Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [October 29, 2022, 8:17am UTC](https://forum.mautic.org/t/mautic-some-table-size-is-increasing-rapidly/25823/9 "2022-10-29T08:17:49Z")

</div>

Hi,  
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.
