Email stats not showing correct "all time" figures

AI-generated summary

The discussion revolves around incorrect “all time” email statistics in Discourse, with user AstonJ noting a discrepancy between the expected total (over 1M) and the displayed figure (257k). User mpalmer explains that recent database cleanup of old records in the email_logs table likely caused the lower count, as the stats rely on COUNT(*). AstonJ expresses disappointment, as email stats are used to gauge forum activity and engagement, particularly for sponsor reporting. Others, like codinghorror, question the usefulness of email stats for community health, suggesting alternative metrics. Mittineague proposes a workaround using the maximum ID minus the current count to estimate deleted records, while AstonJ suggests using the most recent row ID as a proxy for “all time” stats. The conversation highlights a tension between technical limitations and the value of certain metrics for community insight.

In the old stats/dashboard, when looking at emails sent the All column is incorrect (on mine, last 30 days is 105k which sounds about right, but all time is showing as 257k - which I know is incorrect as previously it was over 1M).

I believe there was recently some work done to remove ancient records in the email_logs table, because it was growing without bound and eventually laying waste to entire regions of disk space. Less records in the database could definitely lead to a lower count, if the stats are generated as a simple COUNT(*) ON email_logs.

4 Likes

That’s unfortunate - we’ve been using email stats to track progress of the forum :cry:

Could there have been a way to get the total and then add it as a single entry so that the stats did not ‘break’ while at the same time taking up next to no space? Anyway to get that now?

Some kind of “max id minus count” might give at least an approximation of how many rows were deleted, no?

I suggest picking a better stat.

Perhaps All could just show the most recent row ID? Guess that would be accurate enough?

Thanks for the suggestion but I quite like the email stats - it helps paint a picture of how active the forum is and how interested people are in the content (enough to have email notifications switched on). It was refreshing to see Discourse had this after coming over from other forum platforms.

Nobody I know looks at email stats for any kind of community health metric other than server load and per-email costs. In fact, this is the first I’ve ever heard of it in five years.

1 Like

It’s a metric we use to provide some kind of insight about the forum - we use it on our sponsor info page for example.

With regards to tangible use, you already mentioned two. Other than that it’s interesting to weigh up number of emails sent against other stats - such as number of members and posts made. Low number of emails sent could indicate people aren’t interested enough to subscribe to email notifications.