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