summaryrefslogtreecommitdiff
path: root/schema.sql
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2013-07-03 21:19:13 +0200
committerHelmut Grohne <helmut@subdivi.de>2013-07-03 21:19:13 +0200
commit56d048320a358b2c417cdb2211b3640394a182e9 (patch)
treeef5c52619ff18c4f3391b4eb19301999de4c66e7 /schema.sql
parentf2bd48d342518c11ec7deaeee5b437ac524514de (diff)
downloaddebian-dedup-56d048320a358b2c417cdb2211b3640394a182e9.tar.gz
store hash values as sqlite BLOB
They were previously hex encoded, so this should cut the space consumed by hashes in half. A first benchmark indicates that the savings in database size are in the order of 30%.
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/schema.sql b/schema.sql
index e942c7b..30ed420 100644
--- a/schema.sql
+++ b/schema.sql
@@ -1,6 +1,6 @@
CREATE TABLE package (package TEXT PRIMARY KEY, version TEXT, architecture TEXT, source TEXT);
CREATE TABLE content (id INTEGER PRIMARY KEY, package TEXT, filename TEXT, size INTEGER, FOREIGN KEY (package) REFERENCES package(package) ON DELETE CASCADE);
-CREATE TABLE hash (cid INTEGER, function TEXT, hash TEXT, FOREIGN KEY (cid) REFERENCES content(id) ON DELETE CASCADE);
+CREATE TABLE hash (cid INTEGER, function TEXT, hash BLOB, FOREIGN KEY (cid) REFERENCES content(id) ON DELETE CASCADE);
CREATE TABLE dependency (package TEXT, required TEXT, FOREIGN KEY (package) REFERENCES package(package) ON DELETE CASCADE);
CREATE INDEX content_package_index ON content (package);
CREATE INDEX hash_cid_index ON hash (cid);