Developer forum

Forum » CMS - Standard features » Cleaning up data in EmailMessage

Cleaning up data in EmailMessage

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi guys,

A few years ago I posted a question about deleting marketing data: https://doc.dynamicweb.com/forum/cms-standard-features/cms-standard-features/deleting-newsletter-data

I am now faced with the same challenge and have a few more questions:

1. My EmailMessage table contains about 40GB (!) worth of data. I ran the following query:

select COUNT(*) from EmailMessage WHERE MessageId IN 
(
  select EmailMessageId from EmailMarketingEmail 
)

which gave me just a few records (350+ out of 450.000 or so)

Are the others orphaned rows I can just delete? Or can I even wipe out the entire table?

2. The customer would like to see the (summary) results of old emails (up to a certain date). Do I need any data in the following tables for that:

EmailRecipient
EmailMessageTag
EmailAction

I guess I do, as none of the results are aggregated anywhere, are they?

Imar

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Results are not aggregated.

The size of the email table indicates they are sending out emails with "Create email for each recipient" which they might not need? But yes - you can delete all the orphaned ones.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Thanks, I'll confirm that setting; sounds likely.

 

You must be logged in to post in the forum