SQLite Forum

Without rowid
Login
> Is there any reason that BEFORE and AFTER might not be functionally identical?

Yes, and the reason is that an extra index is required for your BEFORE DB.

For the BEFORE DB:<code>
sqlite> .header on
sqlite> select * from sqlite_master;
type|name|tbl_name|rootpage|sql
table|info|info|2|CREATE TABLE info (token text primary key, ct1 integer, ct2 integer, ct3 integer)
index|sqlite_autoindex_info_1|info|3|
table|counts|counts|4|CREATE TABLE counts  (  xtotal integer not null default 0,  ytotal integer not null default 0  )
table|globals|globals|5|CREATE TABLE globals (app_version integer, data_version integer default 0)
sqlite>
</code>, and for the AFTER DB:<code>
sqlite> .header on
sqlite> select * from sqlite_master;
type|name|tbl_name|rootpage|sql
table|info|info|2|CREATE TABLE info (token text primary key, ct1 integer, ct2 integer, ct3 integer) without rowid
table|counts|counts|3|CREATE TABLE counts  (  xtotal integer not null default 0,  ytotal integer not null default 0  )
table|globals|globals|4|CREATE TABLE globals (app_version integer, data_version integer default 0)
sqlite>
</code>

You have demonstrated why the "without rowid" feature was added.