Simplify GET_LAST_STEP_EXECUTION#3997
Closed
marschall wants to merge 1 commit intospring-projects:mainfrom
Closed
Conversation
Simplify JdbcStepExecutionDao#GET_LAST_STEP_EXECUTION to use an equi-join instead of an cartesian join and a subselect.
Contributor
Author
|
SELECT
se.step_execution_id,
se.step_name,
se.start_time,
se.end_time,
se.status,
se.commit_count,
se.read_count,
se.filter_count,
se.write_count,
se.exit_code,
se.exit_message,
se.read_skip_count,
se.write_skip_count,
se.process_skip_count,
se.rollback_count,
se.last_updated,
se.version,
je.job_execution_id,
je.start_time,
je.end_time,
je.status,
je.exit_code,
je.exit_message,
je.create_time,
je.last_updated,
je.version
FROM
batch_job_execution je,
batch_step_execution se
WHERE
se.job_execution_id IN (
SELECT
job_execution_id
FROM
batch_job_execution
WHERE
job_instance_id = ?
)
AND se.job_execution_id = je.job_execution_id
AND se.step_name = ?
ORDER BY
se.start_time DESC,
se.step_execution_id DESC;This can be simplified to an equi-join SELECT
se.step_execution_id,
se.step_name,
se.start_time,
se.end_time,
se.status,
se.commit_count,
se.read_count,
se.filter_count,
se.write_count,
se.exit_code,
se.exit_message,
se.read_skip_count,
se.write_skip_count,
se.process_skip_count,
se.rollback_count,
se.last_updated,
se.version,
je.job_execution_id,
je.start_time,
je.end_time,
je.status,
je.exit_code,
je.exit_message,
je.create_time,
je.last_updated,
je.version
FROM
batch_job_execution je
JOIN batch_step_execution se ON se.job_execution_id = je.job_execution_id
WHERE
je.job_instance_id = ?
AND se.step_name = ?
ORDER BY
se.start_time DESC,
se.step_execution_id DESC;This is similar to #3876. |
fmbenhassine
pushed a commit
that referenced
this pull request
Jan 13, 2022
Simplify JdbcStepExecutionDao#GET_LAST_STEP_EXECUTION to use an equi-join instead of an cartesian join and a subselect. Issue #3997
Contributor
|
LGTM. Rebased and merged as 8d89a4b. Thank you for your contribution! |
fmbenhassine
pushed a commit
that referenced
this pull request
Jan 13, 2022
Simplify JdbcStepExecutionDao#GET_LAST_STEP_EXECUTION to use an equi-join instead of an cartesian join and a subselect. Issue #3997
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.
Simplify JdbcStepExecutionDao#GET_LAST_STEP_EXECUTION to use an
equi-join instead of an cartesian join and a subselect.