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

Remove unnecessary joins for list node and task execution entities in flyteadmin db queries #5935

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

katrogan
Copy link
Contributor

@katrogan katrogan commented Oct 29, 2024

Why are the changes needed?

for ListNodeExecutions and ListTaskExecutions queries we always force a join on executions, and for the latter, node executions. This is inefficient and unnecessary when we don't reference cross table entities in request filters.

Furthermore, this change updates how we query on execution identifier filters to avoid forcing an unnecessary join there too.

What changes were proposed in this pull request?

See description. This only forces joins when they are necessitated by the presence of request filters.

How was this patch tested?

Setup process

Tested with single binary and verified I could launch executions and interact with the console. I forced cross table joins with request filters and saw SQL logs reflect that.

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

@katrogan katrogan changed the title Remove unnecessary joins for node and task execution entities in flyteadmin db queries Remove unnecessary joins for list node and task execution entities in flyteadmin db queries Oct 29, 2024
Signed-off-by: Katrina Rogan <[email protected]>
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 76.11940% with 16 lines in your changes missing coverage. Please review.

Project coverage is 36.97%. Comparing base (553a702) to head (1f462bd).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...n/pkg/repositories/gormimpl/task_execution_repo.go 57.14% 8 Missing and 4 partials ⚠️
...n/pkg/repositories/gormimpl/node_execution_repo.go 62.50% 2 Missing and 1 partial ⚠️
...cloudevent/implementations/cloudevent_publisher.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5935      +/-   ##
==========================================
+ Coverage   36.84%   36.97%   +0.12%     
==========================================
  Files        1309     1301       -8     
  Lines      130967   130297     -670     
==========================================
- Hits        48259    48176      -83     
+ Misses      78524    77945     -579     
+ Partials     4184     4176       -8     
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 54.10% <76.11%> (-0.04%) ⬇️
unittests-flytecopilot ?
unittests-flytectl 62.40% <ø> (ø)
unittests-flyteidl 6.92% <ø> (ø)
unittests-flyteplugins 53.64% <ø> (ø)
unittests-flytepropeller 43.00% <ø> (ø)
unittests-flytestdlib 55.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Katrina Rogan <[email protected]>
@katrogan katrogan merged commit 01c3519 into master Oct 30, 2024
51 checks passed
@katrogan katrogan deleted the reduce-unnecessary-joins branch October 30, 2024 11:06
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.

2 participants