KPI Summary Table (Materialized View)
Component Detail
Data Layer
medium complexity
backend
0
Dependencies
1
Dependents
0
Entities
0
Integrations
Description
PostgreSQL materialized view or indexed summary table pre-aggregating per-organization activity counts, expense totals, user engagement rates, and assignment metrics. Refreshed on a scheduled basis to avoid full table scans on the activities, expenses, and assignments tables when the dashboard polls for data.
kpi-summary-table
Sources & reasoning
Feature implementation notes explicitly call out materialized views or indexed summary tables to avoid full table scans at scale. This data component represents that persistence layer artifact, distinct from the aggregation service that queries it.
-
docs/source/likeperson.md · line 186Coordinator and organization-level dashboards and KPIs
-
docs/source/likeperson.md · line 317Aktivitetsoversikt og grunnleggende statistikk
-
docs/source/likeperson.md · line 231Admin Web Portal: `admin-dashboard`, `admin-user-management`, `admin-organization`, `admin-security`
Responsibilities
- Store pre-aggregated KPI values per organization and time period
- Support fast point-in-time reads for the KPI Aggregation Service
- Include refresh metadata (last_refreshed_at) for staleness indication
- Partition or filter by organization_id for tenant isolation
Interfaces
SELECT * FROM kpi_summaries WHERE organization_id = :orgId
REFRESH MATERIALIZED VIEW kpi_summaries