Marc-André Bombeck
823764a914
perf(analytics): cap live-fallback findMany at trailing 90 days
...
The per-type loop inside `buildAnalyticsResponse` calls
`fetchMeasurementSeriesChunked` without a `since` filter, so a single
default-slice request pulls every measurement ever for the user across
15 chunked rounds. The v1.4.38.8 per-type fast-path gate made this
unreachable in the common case, but a regression on those gates would
re-trigger Marc's 74.6 s cold full-slice mount.
- Add `ANALYTICS_LIVE_WINDOW_DAYS = 90` + `liveSince` constant.
- Thread `since: liveSince` into every per-type chunked read.
- Annotate `meta.analytics.bp_aggregate.live_since` (ISO) so the next
perf-verify can prove the cap is in effect on a live request.
Defense-in-depth only — the rollup fast-path is unchanged because it
never reaches the per-type loop. Worst-case bound drops from ~347 k
rows to ~5 k rows on Marc's tenant (matching the
comprehensive-aggregator + summaries-slice 90-day windows).
Trade-off: `summarize().avg30LastYear` returns null on the fall-through
path; the dashboard's year-over-year overlay shows "no prior data"
until the rollup tier warms. Acceptable on a degraded path that
v1.4.38.8 already made rare.
Tests: new `src/__tests__/api/analytics/since-cap.test.ts` pins the
90-day floor on every per-type findMany, pins the `live_since`
annotate, and pins that the slim slice is untouched. Existing chunked
paging integration test reseeded with timestamps inside the 90-day
window so it still exercises the two-chunk boundary.
2026-05-18 12:22:11 +02:00
..
2026-05-18 00:07:48 +02:00
2026-05-17 15:36:38 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 14:19:57 +02:00
2026-05-11 02:44:12 +02:00
2026-05-12 22:45:42 +02:00
2026-05-16 13:20:49 +02:00
2026-05-10 12:51:33 +02:00
2026-05-09 16:06:52 +02:00
2026-05-09 16:08:20 +02:00
2026-05-09 18:08:25 +02:00
2026-05-09 18:08:25 +02:00
2026-05-09 17:02:59 +02:00
2026-05-09 18:08:25 +02:00
2026-05-09 18:08:25 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 13:02:39 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 13:12:11 +02:00
2026-05-10 13:15:14 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 13:00:11 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 13:16:19 +02:00
2026-05-10 11:09:41 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 14:01:38 +02:00
2026-05-10 11:09:41 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 17:24:59 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 00:29:22 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 11:09:41 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 11:09:41 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 18:17:55 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 14:55:27 +02:00
2026-05-10 15:17:03 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-11 08:27:51 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 19:31:20 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 15:36:38 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:27:51 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-14 23:49:32 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:28:02 +02:00
2026-05-12 22:33:35 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:28:02 +02:00
2026-05-11 08:28:02 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 15:36:38 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 15:36:38 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-17 19:03:04 +02:00
2026-05-17 17:34:16 +02:00
2026-05-17 19:03:04 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 17:21:25 +02:00
2026-05-17 17:42:06 +02:00
2026-05-17 19:03:04 +02:00
2026-05-17 19:03:04 +02:00
2026-05-17 19:03:04 +02:00
2026-05-17 19:03:04 +02:00
2026-05-17 19:03:04 +02:00
2026-05-17 19:03:04 +02:00
2026-05-18 12:22:11 +02:00
2026-05-10 11:09:41 +02:00
2026-05-09 01:22:09 +02:00
2026-05-16 12:37:55 +02:00
2026-05-14 23:49:32 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-16 09:28:40 +02:00
2026-05-16 09:28:40 +02:00
2026-05-16 09:28:40 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-16 09:28:40 +02:00
2026-05-16 09:28:40 +02:00
2026-05-16 09:28:40 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-16 09:28:40 +02:00
2026-05-16 09:28:40 +02:00
2026-05-16 09:28:40 +02:00
2026-05-16 10:59:42 +02:00
2026-05-17 00:39:58 +02:00
2026-05-17 00:39:58 +02:00
2026-05-17 00:39:58 +02:00
2026-05-18 05:58:24 +02:00
2026-05-17 00:39:58 +02:00
2026-05-17 00:39:58 +02:00
2026-05-17 00:39:58 +02:00
2026-05-17 00:39:58 +02:00
2026-05-17 00:39:58 +02:00
2026-05-16 14:19:57 +02:00
2026-05-16 12:37:55 +02:00
2026-05-16 14:19:57 +02:00
2026-05-16 16:04:21 +02:00
2026-05-16 16:04:21 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 22:26:59 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 21:25:26 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-16 19:46:43 +02:00
2026-05-17 00:06:18 +02:00
2026-05-16 22:26:59 +02:00
2026-05-16 21:25:26 +02:00
2026-05-16 21:25:26 +02:00
2026-05-16 21:25:26 +02:00
2026-05-16 22:26:59 +02:00
2026-05-16 22:26:59 +02:00
2026-05-16 21:25:26 +02:00
2026-05-16 21:25:26 +02:00
2026-05-16 21:25:26 +02:00
2026-05-16 22:26:59 +02:00
2026-05-16 21:25:26 +02:00
2026-05-16 22:26:59 +02:00
2026-05-17 09:55:33 +02:00
2026-05-17 13:22:51 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 13:22:51 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 16:37:51 +02:00
2026-05-17 15:36:38 +02:00
2026-05-17 17:07:12 +02:00
2026-05-18 12:10:02 +02:00
2026-05-17 19:18:56 +02:00
2026-05-17 19:03:04 +02:00
2026-05-14 23:49:32 +02:00
2026-05-15 22:59:10 +02:00
2026-05-12 22:45:42 +02:00
2026-05-16 21:25:26 +02:00
2026-05-09 17:57:30 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 11:09:41 +02:00
2026-05-10 13:12:11 +02:00
2026-05-10 11:10:59 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-11 08:27:51 +02:00
2026-05-12 22:33:35 +02:00
2026-05-15 22:59:10 +02:00
2026-05-14 23:49:32 +02:00
2026-05-14 23:49:32 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-15 22:59:10 +02:00
2026-05-16 03:17:00 +02:00
2026-05-16 03:17:00 +02:00
2026-05-16 09:28:40 +02:00