Skip to content

temp: Add log line to RepoStore.list when query takes >1s

Administrator requested to merge ef/repo-store-list-debug-log into main

Created by: efritz

The query currently exhibiting the most load on our frontend database is (understandably) the from the list repositories function. Particularly, one that counts the number repos used to determine the UI status message. This query runs quickly most of the time, but the 90p of latency is fairly high (a number of seconds). It is incredibly difficult to reproduce the high-latency version of the query - everything we've tried so far results in a decent query plan and takes only double-digit milliseconds.

@eseliger are at a dead-end. In order to proceed we need to find representative parameters that cause this high-latency in order to optimize the query. We'll let this log line run in production for a few hours then remove it once we're able to issue a psql command that gives us the bonkers query plan we're seeing in query insights but no where else.

Merge request reports

Loading