Reputation: 1939
Currently, I have a database where I am using random longs as my IDs, so I don't need an INTEGER PRIMARY KEY. Can I use my own IDs in column 0, or is column 0 automatically taken up by the implicit ROWID regardless?
Upvotes: 0
Views: 97
Reputation: 180080
All tables have a rowid
.
It is not a normal column but used as the key of the table's B-tree structure.
If you declare a column as INTEGER PRIMARY KEY
, that column is used as the rowid
and is not actually stored in the table's data section.
If your primary key is an integer, you should declare it as INTEGER PRIMARY KEY
to make storage and lookups more efficient.
Upvotes: 1