Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up leads custom fields #7494

wants to merge 2 commits into
base: staging


None yet
3 participants
Copy link

commented May 3, 2019

Please be sure you are submitting this against the staging branch.

Bug fix? Y
New feature? N
Automated tests included? N
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs)
BC breaks?


We had 10M+ contacts with lots of custom fields and the cron jobs have started to timeout. That was because the MySQL was timing out. 4+ hours were not enough for 2M contacts to be updated in a single campaign. We managed to find the bad query and modified it so that we are not getting timeouts anymore.

The issue was the dynamically built infinite CASE ... WHEN query

Steps to reproduce the bug:

  1. Create 7M+ contacts
  2. Create 60+ custom fields
  3. Create a Campaign involving 2M+ contacts
  4. Run mautic:campaigns:update

Expected: The campaign contacts had to be updated

Actual: The operation needs a couple of hours to complete and most often it will timeout

Steps to test this PR:

  1. Load up this PR
  2. Repeat steps above. You should receive the Expected results.

List deprecations along with the new alternative:

  1. n/a

List backwards compatibility breaks:

  1. n/a

alanhartless and others added some commits Mar 25, 2019

@npracht npracht added this to the 2.16.0 milestone May 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.