Skip to content

Optimise get row id query#192

Merged
staticlibs merged 1 commit into
duckdb:mainfrom
birdalicious:optimise-rowid-min-max
May 28, 2026
Merged

Optimise get row id query#192
staticlibs merged 1 commit into
duckdb:mainfrom
birdalicious:optimise-rowid-min-max

Conversation

@birdalicious
Copy link
Copy Markdown
Contributor

Sqlite is a lot faster at getting the MIN(ROWID) and MAX(ROWID) separately, the previous query SELECT MIN(ROWID), MAX(ROWID) FROM \"%s\" would cause sqlite to scan the table instead of looking at either end of the B tree. The speed difference is apparent on large tables.

Copy link
Copy Markdown
Member

@staticlibs staticlibs left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good to me.

@staticlibs staticlibs merged commit 7cba871 into duckdb:main May 28, 2026
3 checks passed
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