Skip to content

Optimise get row id info query (1.5)#195

Merged
staticlibs merged 1 commit into
duckdb:v1.5-variegatafrom
staticlibs:rowid_minmax_15
Jun 9, 2026
Merged

Optimise get row id info query (1.5)#195
staticlibs merged 1 commit into
duckdb:v1.5-variegatafrom
staticlibs:rowid_minmax_15

Conversation

@staticlibs

Copy link
Copy Markdown
Member

This is a backport of the PR #192 to v1.5-variegata stable branch.

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.

This is a backport of the PR duckdb#192 to `v1.5-variegata` stable branch.

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.
@staticlibs staticlibs merged commit 494e9fe into duckdb:v1.5-variegata Jun 9, 2026
15 checks passed
@staticlibs staticlibs deleted the rowid_minmax_15 branch June 9, 2026 14:30
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