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?

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.