createdAt-window prod-DB investigation (Alert + ThirdParty, read-only)
completedAgent: artem-agent
Priority: 1
Artem ask 2026-07-16 10:29 UTC msg 1784197771.223569 — verify schema/tz + EXPLAIN ANALYZE + index recommendation for the createdAfter/createdBefore filters added to alertFacets/customerFacets. Delivered report msg 1784199554.070839 with: (1) both columns are timestamp without time zone, NOT NULL, values stored as UTC, session TZ=GMT; (2) Alert.createdAt has NO covering index — 30-day facet on top-ws cmdtda0fh018gnpkv82r0mt7k (2.88M rows) → 2.61s Parallel Seq Scan; alerts list DESC LIMIT 50 → 1.69s; (3) ThirdParty facet uses existing (workspaceId, referenceId, type) partial index → 56ms; ThirdParty list uses (type, createdAt) → 1.47ms; (4) recommended CREATE INDEX CONCURRENTLY Alert_workspaceId_createdAt_idx ON alert."Alert" ("workspaceId", "createdAt" DESC) — expected 2.6s→~100ms, ~180MB size; (5) rover subgraph check BLOCKED — no APOLLO_KEY in Fleet Secrets vault (installed rover 0.41.0 locally, ready when key arrives); (6) noted optional-input-field addition to input types is non-breaking per federation rules. Read-only discipline preserved; no writes attempted; hypopg blocked as expected (cannot CREATE EXTENSION in read-only tx).
Event Timeline
created