Checkpoint: af7afc9a29ff

Entire-Session: c31c699a-f492-48f7-bcf0-35d3ceeac243
Entire-Strategy: manual-commit
Entire-Agent: Claude Code
Ephemeral-branch: entire/eba3995-e3b0c4
This commit is contained in:
2026-03-11 05:46:04 +01:00
parent 41a089efcf
commit a7a96333ad
6 changed files with 256 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# Session Context
## User Prompts
### Prompt 1
Implement the following plan:
# Optimize Job Table Indexes for 20M Row Production Database
## Context
The `job` table has **79 indexes** (created in migrations 08/09), causing:
1. **Wrong index selection** — without `ANALYZE` statistics, SQLite picks wrong indexes (e.g., `jobs_jobstate_energy` instead of `jobs_starttime` for ORDER BY queries), causing full-table temp B-tree sorts on 20M rows → timeouts
2. **Excessive disk/memory overhead** — each index costs ~200-400MB at 20M rows; 79 inde...