- Shipped
- September 16, 2026 at 5:48 PM UTC
- Author
- Kamo
- Commit
- b6f7163
hasEligibleAssignableLead only needs to know whether any pool lead is one the member may take, but it read a page of findAssignablePool, whose ORDER BY assigned_date has no index and sorts the entire pool before the LIMIT. The leads-available endpoint calls it per product on every availability event; with the US farm pools growing it held the database tserver at its 16-core limit. Measured in production on a 16k-lead pool: 1276 ms sorted vs 18 ms unordered. Acceptance keeps the ordered query.