Skip to content

DBA [SQLite] Primary Key discussion - Use guid or int ids ? #3123

Answered by simolus3
Blackstareye asked this question in Q&A
Discussion options

You must be logged in to vote

The sqlite3 documentation page on rowids is somewhat ambivalent on this. On the one hand, it suggests that using a single-integer primary key (aka the rowid) can be beneficial for performance:

Access to records via rowid is highly optimized and very fast.

On the other hand, it also offers this:

In a perfect world, there would be no such thing as a "rowid" and all tables would following the standard semantics implemented as WITHOUT ROWID tables, only without the extra "WITHOUT ROWID" keywords.

While drift supports WITHOUT ROWID tables (by overriding withoutRowId on the table), this is not the default.

I don't think it really depends on the size of the project, but rather the semantic m…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Blackstareye
Comment options

@simolus3
Comment options

@Blackstareye
Comment options

Answer selected by Blackstareye
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants