The feature-runs endpoint filters counts by feature_id, but the available composite index starts with run_id.
The query finds all runs containing a given feature, while the schema only indexes counts(run_id, feature_id). PostgreSQL cannot efficiently use that index for a lookup constrained only by feature_id.
Add an index on (feature_id, run_id) and compare EXPLAIN ANALYZE before and after on a representative counts table.
The feature-runs endpoint filters counts by
feature_id, but the available composite index starts withrun_id.The query finds all runs containing a given feature, while the schema only indexes
counts(run_id, feature_id). PostgreSQL cannot efficiently use that index for a lookup constrained only byfeature_id.Add an index on
(feature_id, run_id)and compareEXPLAIN ANALYZEbefore and after on a representative counts table.