Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add order by id to rkey table scan #35

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

mapogolions
Copy link
Contributor

SQLite does not guarantee the order of row returns by default unless the ORDER BY clause is explicitly specified in the query. This can lead to unpredictable results. If the order is not fixed, there is a possibility that some rows may be lost between queries.

For example:

id > 0 limit 5 -- returns [1, 2, 3, 4, 10]

Values [5, 6, 7, 8, 9] are missing.

id > 10 limit 5 -- returns [11, ...]

@nalgeon
Copy link
Owner

nalgeon commented Sep 21, 2024

Not sure why I chose the unordered implementation at the time, but it looks oddly intentional 🤔

@nalgeon nalgeon merged commit 25b6f41 into nalgeon:main Nov 11, 2024
@nalgeon
Copy link
Owner

nalgeon commented Nov 11, 2024

After further consideration, I see no reason to deny this PR. Thank you!

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.

2 participants