I am trying to import some spatial data (OSM) into an SQLite database. The SQLite reference states that an INTEGER PRIMARY KEY becomes an alias for the rowid (if WITHOUT ROWID is not specified). Just to be sure, I created my main table in two different manners:
CREATE TABLE points (tags BLOB NOT NULL,
lon INTEGER NOT NULL,
lat INTEGER NOT NULL)
vs.
CREATE TABLE points (id INTEGER PRIMARY KEY,
tags BLOB NOT NULL,
lon INTEGER NOT NULL,
lat INTEGER NOT NULL)
I expected the same results, but after running the application twice, my two database files clearly differ in size: The version with explicit primary key takes about 100 MB more of disk space (1.5 GB vs 1.4 GB). My insert statements are equal apart from the fact that one uses "id", the other one "rowid" as destination column for the point ID.
Does anyone have a clue where this massive difference in size comes from? Thanks in advance.