Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Artifacts] Improve list artifact tags db query #5648

Merged
merged 2 commits into from
May 29, 2024

Conversation

TomerShor
Copy link
Member

When listing artifact tags, we first loaded all of the artifacts in the project to the API's memory, then iterated over them and looked for tags in their metadata.
This resulted with a major load on the API and in systems with a large number of artifacts, requests to GET /artifact-tags were stuck and timing out.

To fix it, instead of loading the entire artifacts table then iterating over it, we use a simple join on the artifact tags table and query only the artifact key (needed for permission filtering) and the tag name.
This results with a much quicker query and simpler code.

Resolves https://iguazio.atlassian.net/browse/ML-6611

@TomerShor TomerShor requested review from liranbg and quaark May 28, 2024 20:30
Copy link
Member

@liranbg liranbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

post approve thoughts

server/api/db/sqldb/db.py Outdated Show resolved Hide resolved
@TomerShor TomerShor changed the title [Artifact] Improve list artifact tags db query [Artifacts] Improve list artifact tags db query May 29, 2024
@liranbg liranbg merged commit 4436666 into mlrun:development May 29, 2024
12 checks passed
TomerShor added a commit to TomerShor/mlrun that referenced this pull request May 30, 2024
@TomerShor TomerShor deleted the bugfix/ML-6611-artifac-tags branch May 30, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants