mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Campaign Emails Retrieval takes too much time #5333
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#5333
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BeastMasterGrinder on GitHub (Aug 5, 2025).
Issue
The problem is in SuiteCRM/public/legacy/modules/Emails/Emails.php
on line 3443 where we are running the query:
This works fine, however, on large campaigns for example more than 1 million where its run from EmailManDelievery.php at the later batches.
It fetches all the contacts who are sent the email. So for example in later batches where 1.3 or 2 million contacts are sent. This query will fetch all of them.
The irony is that later in this code the contacts fetched are not used except for 1 record. If we are only going to use it once then maybe we should get only 1 contact instead of millions of contacts?
This happens when we retrieve Emails Bean. Could be just for creating reference emails or anything
Possible Fix
Just get one contact.
Steps to Reproduce the Issue
Context
No response
Version
7.14, 8.2
What browser are you currently using?
Firefox
Browser Version
No response
Environment Information
MySQL 5.6, PHP 8.2
Operating System and Version
Ubuntu 20.0.4