Segment Build Time Warning

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.

1 Like

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

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.

:brain: 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.

:pushpin: 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.

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

Did you add indexes manually on database level?

Yes, because segment membership, email_stats cannot be added in the UI

1 Like