haiku.rag/haiku_rag_slim/haiku/rag/ingester/queue
Chris McDonough 48826031ac Add partial indexes for has_pending() and dashboard throughput queries
has_pending() scans jobs WHERE source_id=? AND status IN
('queued','claimed') on every poller sweep — without an index this
is a full table scan as the jobs table grows. Similarly,
count_succeeded_since() scans by completed_at for the dashboard's
rolling-throughput display.

Add two partial indexes:
- idx_jobs_pending_by_source: covers has_pending() lookups
- idx_jobs_succeeded_completed: covers count_succeeded_since()

Both use CREATE INDEX IF NOT EXISTS so they're idempotent on
existing databases.
2026-06-01 06:28:55 -04:00
..
__init__.py SQLite queue + haiku-ingester CLI skeleton 2026-05-26 11:41:54 +03:00
migrations.py logging, sqlite cursors 2026-05-26 11:41:54 +03:00
models.py SQLite queue + haiku-ingester CLI skeleton 2026-05-26 11:41:54 +03:00
repository.py Add haiku-ingester run-batch, remove run-once 2026-05-29 17:00:59 +03:00
schema.py Add partial indexes for has_pending() and dashboard throughput queries 2026-06-01 06:28:55 -04:00