# Segment Build Time Warning

**URL:** <https://forum.mautic.org/t/segment-build-time-warning/35799>\
**Category:** Mautic 5 Install/Upgrade Support\
**Tags:** discussion\
**Created:** [June 5, 2025, 8:46am UTC](https://forum.mautic.org/t/segment-build-time-warning/35799 "2025-06-05T08:46:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [June 5, 2025, 8:46am UTC](https://forum.mautic.org/t/segment-build-time-warning/35799/1 "2025-06-05T08:46:07Z")

</div>

We run a Mautic with more or less 10.000 contacts. Some of the segments (with combination of segments as well) have build time warnings… a segment with 5.185 resulting contacts took 544 seconds.

What are the limiting factors for the segment building? We didn’t see this issue before.

System has 512MB RAM.

---

<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:** [June 11, 2025, 5:14am UTC](https://forum.mautic.org/t/segment-build-time-warning/35799/2 "2025-06-11T05:14:39Z")

</div>

If you use “Member of a segment” - that is one of the heaviest querries in Mautic.  
Is this an upgraded Mautic where the previous version ran okay?  
J

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [June 11, 2025, 12:52pm UTC](https://forum.mautic.org/t/segment-build-time-warning/35799/3 "2025-06-11T12:52:22Z")

</div>

Hi Joey,  
thanks for looking into it - I don’t have comparisons, as its a relatively young installation. But I did some analysis, into a spreadsheet and let it analyse. Looks like “was sent a specific mail” seems to be the biggest culprit of long runtimes?

Member of a segment is an important filter we also used in those segments (including, excluding - even combined) but seems not to be the main reason - at least in that screened examples.

### 🧠 Key Takeaways:

- **“Was sent a specific mail”** is the **only filter type clearly overrepresented in slow segments**. It appears in 100% of long-running segments and only in 50% of fast ones.
- Other filters like **“tags”** , **“company\_preferred\_locale”** , and **“Stufe”** only appear in the faster segment group.
- **“Segment Membership”** is common in both but slightly more frequent in fast segments, suggesting it’s not a strong contributor to slowness.

### 📌 What This Means:

- **Email interaction filters** (e.g., _“Was sent a specific mail”_) are likely **performance bottlenecks** – probably due to heavy joins or historical data scans.
- You might consider optimizing these segments by:
  - Preprocessing such data into a **custom field or tag** , then filtering based on that.
  - Reducing the number of emails checked, or checking only for **more recent interactions**.

---

<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:** [June 11, 2025, 1:24pm UTC](https://forum.mautic.org/t/segment-build-time-warning/35799/4 "2025-06-11T13:24:30Z")

</div>

We have a 1.5 million Mautic, where we did a bunch of indexes, and that helped tremendously.  
It’s really fast.

---

<div class="post-metadata">

**Author:** ![dirk\_s](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dirk_s/32/748_2.png) [@dirk\_s](https://forum.mautic.org/u/dirk_s)\
**Post date:** [June 11, 2025, 9:18pm UTC](https://forum.mautic.org/t/segment-build-time-warning/35799/5 "2025-06-11T21:18:32Z")

</div>

Did you add indexes manually on database level?

---

<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:** [June 12, 2025, 8:11am UTC](https://forum.mautic.org/t/segment-build-time-warning/35799/6 "2025-06-12T08:11:26Z")

</div>

Yes, because segment membership, email\_stats cannot be added in the UI
