Skip to content

Optimized JdbcPagingItemReader configuration for process indicator pattern [BATCH-2317] #1284

Open
@spring-projects-issues

Description

@spring-projects-issues

Jimmy Praet opened BATCH-2317 and commented

For a new project I'm currently evaluating the performance of using JdbcPagingItemReader versus JdbcCursorItemReader.

The application will make use of a process indicator column in the input table, so saveState="false" will be configured.

In my tests the JdbcCursorItemReader is way faster (5x) than the JdbcPagingItemReader. But this is mostly due to the fact that the JdbcCursorItemReader is doing a simple "SELECT FROM

WHERE AND processed = 0".

The JdbcPagingItemReader however is doing "SELECT FROM

WHERE AND processed = 0 AND > ORDER BY ASC FETCH FIRST 1000 ROWS ONLY".

When working with a process indicator column these " > " and "ORDER BY ASC" clauses are actually not required.

After doing some local hacking to the JdbcPagingItemReader and PagingQueryProvider to remove the sort key condition and order by clause from the query, the performance is comparable to that of JdbcCursorItemReader for this scenario.

The process indicator column is a pattern that is being promoted in the spring batch reference manual, so I think it would be nice to have both standard JDBC reader implementations support this pattern in a performant way.


No further details from BATCH-2317

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions