Commit 933412cd authored by Julien Muchembled's avatar Julien Muchembled

sqlite: minor optimization

Like commit 243c1a0f
("sqlite: optimize storage of metadata"), the fake changes in test
data are because we don't force upgrade for this optimization.
parent d5afef8e
......@@ -165,7 +165,7 @@ class SQLiteDatabaseManager(DatabaseManager):
# parameters which affect the persistent data.
schema_dict['config'] = """CREATE TABLE %s (
name TEXT NOT NULL PRIMARY KEY,
value TEXT)
value TEXT) WITHOUT ROWID
"""
# The table "pt" stores a partition table.
......@@ -173,7 +173,8 @@ class SQLiteDatabaseManager(DatabaseManager):
partition INTEGER NOT NULL,
nid INTEGER NOT NULL,
tid INTEGER NOT NULL,
PRIMARY KEY (partition, nid))
PRIMARY KEY (partition, nid)
) WITHOUT ROWID
"""
# The table "trans" stores information on committed transactions.
......@@ -234,7 +235,8 @@ class SQLiteDatabaseManager(DatabaseManager):
tid INTEGER NOT NULL,
data_id INTEGER,
value_tid INTEGER,
PRIMARY KEY (tid, oid))
PRIMARY KEY (tid, oid)
) WITHOUT ROWID
"""
if self.nonempty('config') is None:
......
BEGIN TRANSACTION;
CREATE TABLE config (
name TEXT NOT NULL PRIMARY KEY,
value TEXT);
value TEXT) WITHOUT ROWID
;
INSERT INTO "config" VALUES('name','testStorageUpgrade');
INSERT INTO "config" VALUES('nid','1');
INSERT INTO "config" VALUES('partitions','3');
......@@ -38,7 +39,9 @@ CREATE TABLE tobj (
tid INTEGER NOT NULL,
data_id INTEGER,
value_tid INTEGER,
PRIMARY KEY (tid, oid));
PRIMARY KEY (tid, oid)
) WITHOUT ROWID
;
CREATE TABLE trans (
partition INTEGER NOT NULL,
tid INTEGER NOT NULL,
......
BEGIN TRANSACTION;
CREATE TABLE config (
name TEXT NOT NULL PRIMARY KEY,
value TEXT);
value TEXT) WITHOUT ROWID
;
INSERT INTO "config" VALUES('name','testStorageUpgrade');
INSERT INTO "config" VALUES('nid','2');
INSERT INTO "config" VALUES('partitions','3');
......@@ -38,7 +39,9 @@ CREATE TABLE tobj (
tid INTEGER NOT NULL,
data_id INTEGER,
value_tid INTEGER,
PRIMARY KEY (tid, oid));
PRIMARY KEY (tid, oid)
) WITHOUT ROWID
;
CREATE TABLE trans (
partition INTEGER NOT NULL,
tid INTEGER NOT NULL,
......
BEGIN TRANSACTION;
CREATE TABLE config (
name TEXT NOT NULL PRIMARY KEY,
value TEXT);
value TEXT) WITHOUT ROWID
;
INSERT INTO "config" VALUES('name','testStorageUpgrade');
INSERT INTO "config" VALUES('nid','3');
INSERT INTO "config" VALUES('partitions','3');
......@@ -36,7 +37,9 @@ CREATE TABLE tobj (
tid INTEGER NOT NULL,
data_id INTEGER,
value_tid INTEGER,
PRIMARY KEY (tid, oid));
PRIMARY KEY (tid, oid)
) WITHOUT ROWID
;
CREATE TABLE trans (
partition INTEGER NOT NULL,
tid INTEGER NOT NULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment