Unusual Emails Module Behaviour

Hi all,

Iā€™ve recently upgraded from SuiteCRM 7.8.28 to 7.11.3 using the upgrade package. Everything is working ok except the emails module. Whenever I go to load the module, it takes about a minute for the whole thing to load. Iā€™ve attached a portion of the logs which seem to show a separate SQL query running for each email? Iā€™m not sure. In the full log, it just keeps repeating except the number after ā€œemails.uid LIKEā€ changes.

Has anyone else had this issue?

Edit:
Iā€™m using PHP 7.3 on an Amazon EC2 Linux instance and a MySQL database version 5.7.22

Do you have any Workflow or logic hook running on Email records?

I faced the same
In my case, it was saying ā€œImap was brokenā€.
Try to edit email settings and put password again.
figner crossed!

hey geneoz,
i am facing the same issue. can anyone suggest a solution for this?

Hi all,

So looking at the difference between the database schemas for 7.8.28 and 7.11.3, thereā€™s an addition of the ā€˜uidā€™ column on the emails table. I also noticed there wasnā€™t an index for this column. I ended up adding an index for the ā€˜uidā€™ column and the emails module now loads in about 2 seconds; much better performance.

This seems a bit unusual if this is the root cause since a lot more people should have been experiencing this issueā€¦ Would someone be able to confirm whether that index is supposed to be there, and if it is, is it possible the index wasnā€™t applied during the upgrade process?

In my 7.11.3 the ā€œemailsā€ table has an index for the ā€œidā€ field, but not for the ā€œuidā€ field. I never noticed a problem with performance, but then I donā€™t use the emails module, I use it only for tests.

I donā€™t know if this is really a problem with the index or if there is something else causing it to do too many queries. How many emails do you have in that table?

Hi pgr,

We have around 350,000 emails in that table, so a fair bit.

I imagine SuiteCRM does a query for current emails in the inbox to test whether it has been imported? Is that what the ā€˜uidā€™ column is used for?

Iā€™m not sure what it is for, I donā€™t know that part of the code.

Iā€™ll pass the information about this to the dev team, maybe that index is good to add for everyone.