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 [1.6.x] #5654

Merged
merged 3 commits into from
May 30, 2024

Conversation

quaark
Copy link
Member

@quaark quaark commented May 29, 2024

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

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

  1. Got all tags with the given tag name, join on their functions and return function uids
  2. Query all functions that match the resulting uids
  3. 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:

  1. Query all functions, joined* on the function tags, filtered by tag name. (This will already return the permutations)
  2. 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.

@TomerShor TomerShor changed the title [API] Improve List Functions Tag Filtering [API] Improve List Functions Tag Filtering [1.6.x] May 29, 2024
@liranbg liranbg merged commit 0439055 into mlrun:1.6.x May 30, 2024
12 checks passed
quaark added a commit to quaark/mlrun that referenced this pull request May 30, 2024
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

3 participants