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?