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

[API] Improve List Functions Tag Filtering #5657

Merged
merged 3 commits into from
May 30, 2024

Conversation

quaark
Copy link
Member

@quaark quaark commented May 30, 2024

https://iguazio.atlassian.net/browse/ML-6640

Port #5654

Previously to filter and attach the tags to the list functions method, we:

Got all tags with the given tag name, join on their functions and return function uids
Query all functions that match the resulting uids
For each function:
a. Query function's tags and add all the permutations of (function, tag) to the resulting list.
This is basically runs O(n) queries where n is the amount of functions.

Now we:

Query all functions, joined* on the function tags, filtered by tag name. (This will already return the permutations)
For each function build the function object from the resulting function and tag permutation.
*outer join if no specific tag was requested so we return functions that are tag-less, and a simpler join when querying on a specific tag as in that case tag-less functions are irrelevant.

This now is just 1 query to the DB.

@liranbg liranbg merged commit 36b5ff8 into mlrun:development May 30, 2024
11 checks passed
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