Skip to content

Use keyed pagination for article lists#1972

Merged
jocmp merged 4 commits intomainfrom
jc/keyed-paging
Apr 11, 2026
Merged

Use keyed pagination for article lists#1972
jocmp merged 4 commits intomainfrom
jc/keyed-paging

Conversation

@jocmp
Copy link
Copy Markdown
Owner

@jocmp jocmp commented Mar 29, 2026

Replace OFFSET-based paging with SQLDelight's KeyedQueryPagingSource using published date as the keyset key.

Benchmarks show ~8x faster paging across 13k articles (2s down to 250ms)

Ref

@jocmp jocmp force-pushed the jc/keyed-paging branch from 96bf872 to ac3bc2d Compare March 29, 2026 01:25
@jocmp jocmp closed this Mar 29, 2026
@jocmp jocmp deleted the jc/keyed-paging branch March 29, 2026 03:24
@jocmp jocmp restored the jc/keyed-paging branch April 8, 2026 02:33
@jocmp jocmp reopened this Apr 8, 2026
@jocmp jocmp changed the title Use keyset pagination for article lists Use keyed pagination for article lists Apr 8, 2026
@jocmp
Copy link
Copy Markdown
Owner Author

jocmp commented Apr 8, 2026

wrong branch

@jocmp jocmp closed this Apr 8, 2026
@jocmp jocmp reopened this Apr 11, 2026
@jocmp jocmp force-pushed the jc/keyed-paging branch from 7749c57 to f8e39df Compare April 11, 2026 04:59
@jocmp jocmp marked this pull request as ready for review April 11, 2026 05:03
@jocmp jocmp force-pushed the jc/keyed-paging branch from f8e39df to 0e64de2 Compare April 11, 2026 05:13
jocmp added 3 commits April 11, 2026 14:33
Replace OFFSET-based paging with SQLDelight's
KeyedQueryPagingSource using published date as the
keyset key.

Benchmarks show ~8x faster paging
across 13k articles (2s down to 250ms)
Remove offset-based all() and allNewestFirst/
allOldestFirst SQL from BySavedSearch and ByToday
(kept in ByArticleStatus and ByFeed for tests).

Add keyed pagination tests verifying correct order
for both newest-first and oldest-first across 5
articles with page size of 2.

Add read_later column, convert starred
@jocmp jocmp force-pushed the jc/keyed-paging branch 3 times, most recently from 7983466 to 2e5d310 Compare April 11, 2026 23:32
@jocmp jocmp force-pushed the jc/keyed-paging branch from 2e5d310 to b58572a Compare April 11, 2026 23:43
@jocmp jocmp merged commit 4b411b7 into main Apr 11, 2026
2 checks passed
@jocmp jocmp deleted the jc/keyed-paging branch April 11, 2026 23:57
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.

1 participant