-
Notifications
You must be signed in to change notification settings - Fork 358
Add Sqlite test for read/write row counters for large rows #2718
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
Conversation
|
||
db.run("CREATE TABLE large_things (id INTEGER PRIMARY KEY, large_value TEXT)"); | ||
|
||
// SQLite's default page size is 4096 bytes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an assertion for the default page size? It seems pragma_page_size()
is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added!
@@ -663,6 +663,36 @@ KJ_TEST("SQLite write row counters (basic)") { | |||
} | |||
} | |||
|
|||
KJ_TEST("SQLite read/write row counters (large row insert)") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to comment why we have this test (either in the commit message or with a comment here).
I believe it's to make sure that extra page reads aren't included in the row count.
Does it also make sense to have more than one row for this test? I don't know how big rows are actually stored in SQLite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big rows are stored in what is called overflow pages - https://www.sqlite.org/fileformat2.html#ovflpgs
I don't think having multiple rows in the test is going to give us any new information.
Will add the comment
6741446
to
e8559d7
Compare
e8559d7
to
a33e1a8
Compare
No description provided.