# Segment Campaign Condition Slow

**URL:** <https://forum.mautic.org/t/segment-campaign-condition-slow/25268>\
**Category:** General Discussion\
**Created:** [September 2, 2022, 5:16pm UTC](https://forum.mautic.org/t/segment-campaign-condition-slow/25268 "2022-09-02T17:16:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pwned555](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pwned555/32/3848_2.png) [@pwned555](https://forum.mautic.org/u/pwned555)\
**Post date:** [September 2, 2022, 5:16pm UTC](https://forum.mautic.org/t/segment-campaign-condition-slow/25268/1 "2022-09-02T17:16:34Z")

</div>

I’m wondering what the reasoning behind having Mautic Campaign Condition for checking if a user belongs to a Segment re-running the segment query is? It makes them unusable for large / slow segments.

For example, I have Segments 1-5 that all take an hour to build, now I want to have a campaign that sends some different emails depending on which segment 1-5 the user belongs to. If I add a condition to check if the user belongs to segment 1 it takes forever because it actually re-queries the segment instead of just checking the lead\_lists\_leads table. It also is a huge amount of overhead on the system. If a user wanted to make sure their segments were up to date before the condition they could simply run mautic:segments:update before mautic:campaigns:update / mautic:campaigns:trigger.

I feel like this is illogical from a code perspective too, by adding that condition I’m telling Mautic to check if a user belongs to the segment. It doesn’t imply that I’m also telling Mautic to update that segment.

[Conditions | Mautic](https://docs.mautic.org/en/campaigns/using-campaign-builder/conditions)  
The documentation states: **Contact segments** Checks if the Contact is a member of selected Segments. To me that implies that it checks the lead\_lists\_leads table and doesn’t update the segment.

I’m assuming this is actually how it works by viewing the processlist in the database but if I’m incorrect in that assumption please let me know and I’ll see why my instance is re-querying the segment instead of just querying the lead\_lists\_leads table. Maybe it’s not actually updating the segment but just re-running the query? If so I don’t see why it wouldn’t just check the lead\_lists\_leads table instead.
