From 0c15ecc9d06b26fa714611e96624aa679264b27d Mon Sep 17 00:00:00 2001 From: Julian Bez Date: Thu, 30 Apr 2026 23:07:42 +0200 Subject: [PATCH] fix(phlower): drop covering index that blocks pod startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #24 merged with a (finished_at, task_id) covering index in the SCHEMA. On the existing prod DB (~26 GB) the CREATE INDEX takes 20+ min — longer than the 3 min startup probe budget. Each pod restart is killed mid-build, SQLite rolls back the partial index, net zero progress. Pod stuck in CrashLoopBackOff for 30+ min. The index was a marginal optimization, not a fix. The batched purge from PR #24 already solves the lock-holding death spiral. Without the new index the inner SELECT still uses idx_inv_finished (fast filter) plus the PK autoindex on invocation_details (covering) — verified clean query plan via EXPLAIN. Removing it lets prod-us pod start in seconds. --- src/phlower/sqlite_store.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/phlower/sqlite_store.py b/src/phlower/sqlite_store.py index bd3b40e..684c8db 100644 --- a/src/phlower/sqlite_store.py +++ b/src/phlower/sqlite_store.py @@ -38,7 +38,6 @@ def wrapper(self, *args, **kwargs): exception_type TEXT ); CREATE INDEX IF NOT EXISTS idx_inv_finished ON invocations (finished_at); -CREATE INDEX IF NOT EXISTS idx_inv_finished_task ON invocations (finished_at, task_id); CREATE INDEX IF NOT EXISTS idx_inv_task_name ON invocations (task_name, finished_at); CREATE TABLE IF NOT EXISTS invocation_details (