Skip to content

database: Don't batch default repo fetching

Administrator requested to merge faster-default-repos-v2 into main

Created by: ryanslade

After digging into why ListDefaultRepos is slow and chatting through different optimisation strategies we concluded that there's no need to paginate our requests. Paginating leads to duplicate work in the database since each page still needs to perform a lot of work to then throw away the data that is not within range for the current page.

Postgres is smart enough to stream results back as they are requested and we can limit memory usage in our Go code where necessary by using rows.Next() to fetch data in chunks.

Merge request reports

Loading