Repository navigation
Load runs list job submissions without sorting all of them - #4472
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On dstack Sky, slow
/api/runs/listrequests spend 0.6-1.8 s loading jobs, because the server sorts every submission of the listed runs with all its columns to keep the latest ones, and does it twice. Fixes #4468.job_submissions_limitof the latest one, plus the latest submission with a termination reason; a job whose submission numbers have gaps from deleted no-capacity submissions can get fewer thanjob_submissions_limitsubmissions, which the API already allows.ix_jobs_run_idwith an index on(run_id, replica_num, job_num, submission_num), so each job's latest submissions are an index lookup; without it, SQLite, which has no hash join, is slower than before for runs with many replicas.job_submissions_limitrequired in the runs list service and drop the unreachable full-history branch, since the router always passes a limit.In a benchmark with 100 runs per page, loading jobs for runs with 200 submissions each goes from 103 ms to 16 ms on Postgres, and for runs with 50 replicas × 20 submissions from 828 ms to 167 ms on SQLite.