-- bytes is the url's share of its shard's xml, so filling a shard never has to render it CREATE TABLE urls ( url TEXT PRIMARY KEY, shard INTEGER NOT NULL, lastmod TEXT NOT NULL, changefreq TEXT, priority REAL, bytes INTEGER NOT NULL ) WITHOUT ROWID; CREATE INDEX urls_by_shard ON urls (shard); -- the url each record last made, because a delete carries no record and a -- rename keeps the uri CREATE TABLE records ( uri TEXT PRIMARY KEY, url TEXT NOT NULL ) WITHOUT ROWID; -- dirty counts up on every change so a render only clears what it saw CREATE TABLE shards ( shard INTEGER PRIMARY KEY, lastmod TEXT NOT NULL, dirty INTEGER NOT NULL DEFAULT 0 ); CREATE TABLE state ( key TEXT PRIMARY KEY, value TEXT NOT NULL ) WITHOUT ROWID;