Notification Statistics Persistence
Summary
There is no statistics table. Notification statistics are computed on demand by counting rows, with no materialised aggregate, rollup, snapshot or counter column anywhere in the schema.
Audience
Engineers, architects, QA, support and DevOps engineers.
Verified absence
The context maps seven entities and none of them is an aggregate, summary, rollup or counter table. No reviewed code path maintains a running total, increments a stored counter, or writes a periodic snapshot.
How statistics are produced
The statistics endpoint issues eight separate count queries in a single handler and projects the results into one anonymous response:
| Count | Source table | Predicate |
|---|---|---|
| Templates | templates | none |
| Recipients | recipients | none |
| Messages | messages | none |
| Sent | messages | status is sent |
| Failed | messages | status is failed |
| Read | messages | status is read |
| Processed events | idempotency ledger | none |
| Delivery attempts | attempts | none |
Cost characteristics
Every call performs eight aggregate scans across four tables, none of them tenant-filtered and none of them time-bounded. The three status counts filter on a status column that no index leads with. Cost therefore grows linearly with total stored volume, and because nothing is ever deleted, that volume only increases.
Scope
The counts are platform-wide. No tenant, channel, date or event-type dimension is applied or accepted, so the result cannot be attributed to a tenant.
Classification
Foundation — a working aggregate read exists; no statistics persistence exists.
Requires confirmation
Whether materialised statistics, tenant dimensions or time windows are planned requires confirmation.
Related Articles
See Also
Keywords
- Notification database
- Statistics Storage
- Draft database documentation
Source References
microservices/src/notification-service/Api/NotificationEndpoints.csmicroservices/src/notification-service/Infrastructure/NotificationDbContext.csmicroservices/src/notification-service/Domain/NotificationEntities.cs
Revision Information
- Status: Draft
- Last reviewed: 2026-07-21
- Review cycle: Quarterly