Skip to content

Optimize JdbcJobExecutionDao#findJobExecutions by reusing the provided JobInstance#5300

Open
l2yujw wants to merge 4 commits intospring-projects:mainfrom
l2yujw:perf/jdbc-findjobexecutions-reuse-jobinstance
Open

Optimize JdbcJobExecutionDao#findJobExecutions by reusing the provided JobInstance#5300
l2yujw wants to merge 4 commits intospring-projects:mainfrom
l2yujw:perf/jdbc-findjobexecutions-reuse-jobinstance

Conversation

@l2yujw
Copy link

@l2yujw l2yujw commented Feb 23, 2026

Motivation

JdbcJobExecutionDao#findJobExecutions(JobInstance) already receives a JobInstance, but it previously delegated to getJobExecution(executionId) for each execution id.
That code path re-fetches the JobInstance per execution, resulting in redundant database round-trips (2 * N) in this specific path.

Changes

Reuse the provided JobInstance when mapping JobExecution rows in findJobExecutions(JobInstance).
Factor the shared row-mapping logic into a small private helper (mapJobExecution).
Keep the public getJobExecution(executionId) behavior unchanged.

Notes

Updated the TODO comment to reflect remaining opportunities to reduce round-trips further (e.g., retrieving executions and parameters in fewer queries).

Signed-off-by: l2yuPa <jeungwon28@gmail.com>
Signed-off-by: l2yuPa <jeungwon28@gmail.com>
@l2yujw l2yujw force-pushed the perf/jdbc-findjobexecutions-reuse-jobinstance branch from 2670910 to 529bc9a Compare February 23, 2026 06:59
Signed-off-by: l2yuPa <jeungwon28@gmail.com>
Signed-off-by: l2yuPa <jeungwon28@gmail.com>
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