Page 1 of 1

Raw email tool

Posted: Fri Nov 09, 2018 6:47 pm
by ForrestGumpDDS
I was running this tool today in a hope to deflate the emailmessage table.
Is this output normal?
Image

Re: Raw email tool

Posted: Sat Nov 10, 2018 9:10 am
by cmcgehee
My guess is that you have a lot of email messages that do not have a matching email address. If that's the case, this query would return a high number:
SELECT COUNT(*)
FROM emailmessage m
LEFT JOIN emailaddress a ON a.EmailUsername=m.RecipientAddress
WHERE a.EmailAddressNum IS NULL

Re: Raw email tool

Posted: Tue Nov 13, 2018 10:57 am
by ForrestGumpDDS
cmcgehee wrote:My guess is that you have a lot of email messages that do not have a matching email address. If that's the case, this query would return a high number:
SELECT COUNT(*)
FROM emailmessage m
LEFT JOIN emailaddress a ON a.EmailUsername=m.RecipientAddress
WHERE a.EmailAddressNum IS NULL
The number returned by the query is 16,132
It seems high.
Does that mean all those emails are not attached to the patient's charts. Like in case where the patient would list one or no email on the forms, and have a communication using another email address, thus OD does not know to whom this email conversation belongs?
I am trying to figure out what to do with those emails. The table emailmessage is huge. Maybe the solution on how to get raw email tool work on all of those messages will also give me a decent deflation of the emailmessage table?

Re: Raw email tool

Posted: Wed Nov 14, 2018 8:49 am
by cmcgehee
Those emails will still show up on the patients' charts. It's just that OD won't be able to link those emails to a row in the email address for the sender. From what I can think of, I don't think it will cause an noticeable problem. What is your motivation for deflating the email message table? Are queries related to emails running slowly?

Re: Raw email tool

Posted: Tue Nov 27, 2018 4:00 pm
by ForrestGumpDDS
Just the time that it takes the OD to update, well, maybe megabytes too, each backup is close to 0.5Gb (archived version).

Re: Raw email tool

Posted: Wed Nov 28, 2018 7:50 am
by cmcgehee
That makes sense. My guess is that the rest of the rows in your emailmessage table are emails that don't have anything in the RawEmailIn column. The raw email tool is only meant to clean up that column; it doesn't clear out the BodyText column because you would be losing communication data if it did.