spring-data-relational icon indicating copy to clipboard operation
spring-data-relational copied to clipboard

FEATURE: Window Scrolling API (Offset/Keyset pagination) [Spring Data JDBC]

Open chrshnv opened this issue 3 months ago • 3 comments

This PR introduces an implementation of Window Scrolling API for Spring Data JDBC, providing efficient, index-friendly pagination over ordered datasets. Unlike traditional offset pagination, the new API uses keyset (window) navigation, which enables constant-time performance even on large tables.

Example query:

WHERE ("DUMMY_ENTITY"."ID_PROP" >= :id_prop AND ("DUMMY_ENTITY"."ID_PROP" > :id_prop1 OR ("DUMMY_ENTITY"."POINT_IN_TIME" > :point_in_time))) ORDER BY "DUMMY_ENTITY"."ID_PROP" ASC, "DUMMY_ENTITY"."POINT_IN_TIME" ASC LIMIT 2

chrshnv avatar Oct 06 '25 15:10 chrshnv

i guess done. awaiting your reviews!

chrshnv avatar Oct 07 '25 03:10 chrshnv

I have a question about the KeysetScrollPosition specification. Should users use property names from POJO or column names from the database?

chrshnv avatar Oct 08 '25 03:10 chrshnv

Thanks for your pull request. This is interesting but we don't have currently the bandwidth to evolve JDBC support. We will come back to this one next year or so.

mp911de avatar Oct 20 '25 13:10 mp911de