Skip to content

fix(select): use native after option for pagination on Tarantool 2.10+#491

Merged
vakhov merged 1 commit intomasterfrom
fix/select-pagination-native-after
Feb 12, 2026
Merged

fix(select): use native after option for pagination on Tarantool 2.10+#491
vakhov merged 1 commit intomasterfrom
fix/select-pagination-native-after

Conversation

@vakhov
Copy link
Copy Markdown
Contributor

@vakhov vakhov commented Feb 10, 2026

Optimize crud.select() and crud.pairs() pagination with after cursor by using native after option on Tarantool 2.10+ for O(1) cursor positioning instead of O(N) scroll_to_after_tuple.

The optimization applies to all iterators (GT/GE/LT/LE/EQ/REQ). For EQ/REQ iterators, native after is used only when after_tuple key matches scan_value to avoid 'Iterator position is invalid' error.

Readview operations use native after only on Tarantool 3.x, since the after option for read_view:pairs() is not available in 2.x.

  • Tests
  • Changelog
  • Documentation

Closes #488

@vakhov vakhov force-pushed the fix/select-pagination-native-after branch from b27adc3 to 3418643 Compare February 10, 2026 06:47
@vakhov vakhov marked this pull request as draft February 10, 2026 06:48
@vakhov vakhov marked this pull request as ready for review February 10, 2026 08:00
@vakhov vakhov requested review from Satbek and ita-sammann February 10, 2026 08:01
@vakhov vakhov self-assigned this Feb 10, 2026
@ita-sammann
Copy link
Copy Markdown
Contributor

ita-sammann commented Feb 10, 2026

I think we should move version updates in workflow and Makefile to separate PR because it's not a part of this feature.

@vakhov vakhov force-pushed the fix/select-pagination-native-after branch from 3418643 to c1a9e46 Compare February 10, 2026 09:12
@vakhov
Copy link
Copy Markdown
Contributor Author

vakhov commented Feb 10, 2026

I think we should move version updates in workflow and Makefile to separate PR because it's not a part of this feature.

Thanks for the suggestion. Agreed. I’ve removed version updates from this PR and will put them into a separate PR.

@vakhov vakhov force-pushed the fix/select-pagination-native-after branch 3 times, most recently from 53e5b9b to ca89634 Compare February 10, 2026 17:29
Optimize crud.select() and crud.pairs() pagination with after cursor
by using native after option on Tarantool 2.10+ for O(1) cursor
positioning instead of O(N) scroll_to_after_tuple.

The optimization applies to all iterators (GT/GE/LT/LE/EQ/REQ).
For EQ/REQ iterators, native after is used only when after_tuple
key matches scan_value to avoid 'Iterator position is invalid' error.

Readview operations use native after only on Tarantool 3.x, since
the after option for read_view:pairs() is not available in 2.x.

Closes #488
@vakhov vakhov force-pushed the fix/select-pagination-native-after branch from ca89634 to e9e3b4e Compare February 10, 2026 17:29
@vakhov vakhov merged commit 6da7ed5 into master Feb 12, 2026
35 checks passed
@vakhov vakhov deleted the fix/select-pagination-native-after branch February 12, 2026 08:36
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.

Performance degradation: slow pagination with after cursor on secondary index

3 participants