Skip to content

perf(api): improve query performance for listing repositories

Related to #948 (closed)

What

Improves the query performance for the database query introduced in !1192 (merged)

Why

The original query was taking over 10s to execute (logs)

In the MR 🎁

  • We added a check for if a namespace exists for the request specified path before proceeding to fetch the list of repositories. if a namespace does not exist we return a 404 immediately

  • We added a top_level_namespace_id = filter when querying the repositories table for sub-repositories. Prior to MR the query was doing index scan on every single (64) partition of the tags table, as reported in: #948 (comment 1318773952). Which can be particularly impactful when a namespace does not exist on the registry side.

Edited by Suleimi Ahmed

Merge request reports