Data retention

Every night (04:30 UTC) old rows are removed from the tables that grow without limit. Report totals (Layer 3, subscription_v2, Subscription Summary) are never removed.

OFF Nothing is removed.
Data Tables Keep (days) Default Last run (UTC) Rows removed
Landing page traffic raw_traffic_statistics 90 never –
Charges and subscription histories raw_charges, raw_subscription_histories 180 never –
Daily subscription activity (Layer 2) daily_subscription_activity, daily_subscription_package_activity 90 never –
Failed events failed_events 30 never –

What is kept. Nothing from a country's oldest day still counted live (not closed yet) is removed, so every day close has its data. From old charges and subscription histories, each subscription's latest status change, subscribe, ad network attribution and successful charge are kept, because the day close still looks them up. A closed day whose Layer 2 was removed is never rewritten in subscription_v2.

After a removal, days older than the charges and histories retention can't be recounted (POST /api/admin/backfill?source=raw refuses them); use source=billing_reports instead. Countries deleted under Countries are skipped: their rows are kept.