The SQLite manager from FireFox when adding fields to the table automatically creates a field with rowid which in my case is completely unnecessary
1 answer
Surprised, but it is written in the documentation for SQLite : you need to specify in CREATE TABLE ...
CREATE TABLE IF NOT EXISTS wordcount( word TEXT PRIMARY KEY, cnt INTEGER ) WITHOUT ROWID; --^^^^^^^ ^^^^^ вот это This has a lot of pros and cons, which are painted in the same place. The most important:
- In a table without
rowidmust be a primary key . AUTOINCREMENTwill not work .sqlite3_update_hook()will not work on tables withoutrowid.- The table will be arranged easier , since it will not have a mandatory index with a
rowid, some types of search will be faster.
|