Skip to content

feat(task): add index on job_job, let job query data range configurable #4440

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

Open
wants to merge 2 commits into
base: dev/4.3.x
Choose a base branch
from

Conversation

LioRoger
Copy link
Collaborator

…ult value -1

What type of PR is this?

type-feature

What this PR does / why we need it:

in previous code implementation, job will only process create_time in recent 30 days. that may lead to some job run over 30 days not handled

make this value configurable and assign default value with -1 means process all suitable jobs.

use status, executor_destroyed_time, create_time to query job_job table may leads to full table scan.

add index (status, executor_destroyed_time) on job_job to accelerate this query.
The following is time cost for 500 thousands records in job_job with SQL select count(1) from job_job where executor_destroyed_time is null and status in ('DONE', 'FAILED', 'CANCELED')
without index cost 1.1s
with index cost 0.1s

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:


@LioRoger LioRoger added this to the 4.3.x milestone May 15, 2025
@LioRoger LioRoger self-assigned this May 15, 2025
@LioRoger LioRoger added the type-feature The functionality to be implemented label May 15, 2025
@LioRoger LioRoger added this to ODC May 15, 2025
@github-project-automation github-project-automation bot moved this to New in ODC May 15, 2025
guowl3
guowl3 previously approved these changes May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature The functionality to be implemented
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

2 participants