-- Trouve-KA — migration 002 : index de claim par priorité -- Author: Simon-Pierre Boucher -- Contact: contact@spboucher.ai -- -- Le claim ordonne par priority DESC; l'index 001 (next_crawl_at, priority) -- force un tri de toutes les lignes dues à chaque claim. Cet index sert -- l'ORDER BY directement (la plupart des lignes pending sont dues). BEGIN; CREATE INDEX IF NOT EXISTS idx_frontier_priority ON frontier_items (priority DESC, next_crawl_at) WHERE status = 'pending'; INSERT INTO schema_migrations (version) VALUES (2) ON CONFLICT DO NOTHING; COMMIT;