Skip to content

Change tail.bcdc_promise() to use reverse order + head() rather than skip records - #380

Merged
ateucher merged 3 commits into
mainfrom
tail-reverse-sort
Nov 17, 2026
Merged

ateucher merged 3 commits into
mainfrom
tail-reverse-sort

Conversation

@ateucher

@ateucher ateucher commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Basically, instead of counting the rows and setting startIndex to a really large row number (i.e., N rows minus number of rows requested in tail()), it selects n rows starting counting backwards from the last record, then resorts those rows before returning it. Not a high priority for fixing it as I would guess the number of people who have ever used tail() is very low, but the tests are super slow and cause timeouts!

  • this is much more efficient on the server side than finding the number of records and setting a really high startIndex. The tests for this cause a lot of timeout failures.
  • Also chose a point record with fewer rows for the tests for head and tail (but still requires pagination)
  • Output order is restored by collect()

* this is much more efficient on the server side than finding the number of records and setting a really high startIndex. The tests for this cause a lot of timeout failures.
* Also chose a point record with fewer rows for the tests for head and tail (but still requires pagination)
@ateucher ateucher changed the title Change tail.bcdc_promise() to reverse order then head() rather than skip records Change tail.bcdc_promise() to user reverse order + head() rather than skip records Nov 16, 2026
@ateucher ateucher changed the title Change tail.bcdc_promise() to user reverse order + head() rather than skip records Change tail.bcdc_promise() to use reverse order + head() rather than skip records Nov 16, 2026

@boshek boshek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice little improvement!

@ateucher
ateucher merged commit 20d52df into main Nov 17, 2026
9 checks passed
@ateucher
ateucher deleted the tail-reverse-sort branch November 17, 2026 23:49
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.

3 participants