Skip to content

Commit cafd35c

Browse files
mchebanfmbenhassine
authored andcommitted
Improve performance in JdbcStepExecutionDao
Optimize SQL in GET_LAST_STEP_EXECUTION to work fast on large amount of records in %PREFIX%JOB_EXECUTION table
1 parent b50c665 commit cafd35c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcStepExecutionDao.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
9898
" from %PREFIX%JOB_EXECUTION JE, %PREFIX%STEP_EXECUTION SE" +
9999
" where " +
100100
" SE.JOB_EXECUTION_ID in (SELECT JOB_EXECUTION_ID from %PREFIX%JOB_EXECUTION " +
101-
"where JE.JOB_INSTANCE_ID = ?)" +
101+
"where JOB_INSTANCE_ID = ?)" +
102102
" and SE.JOB_EXECUTION_ID = JE.JOB_EXECUTION_ID " +
103103
" and SE.STEP_NAME = ?" +
104104
" order by SE.START_TIME desc, SE.STEP_EXECUTION_ID desc";

0 commit comments

Comments
 (0)