From f0887afd9b91f9b837b81d551c185bf9d4af4599 Mon Sep 17 00:00:00 2001 From: Celes Renata Date: Thu, 16 Apr 2026 09:24:31 +0000 Subject: [PATCH] fix: cap competitive signals to 500 most recent per window to prevent 67k row aggregation bottleneck --- services/aggregation/worker.py | 1 + 1 file changed, 1 insertion(+) diff --git a/services/aggregation/worker.py b/services/aggregation/worker.py index 7ef1388..7f9aaa9 100644 --- a/services/aggregation/worker.py +++ b/services/aggregation/worker.py @@ -244,6 +244,7 @@ WHERE target_ticker = $1 AND computed_at >= $2 AND computed_at <= $3 ORDER BY computed_at DESC +LIMIT 500 """