From 6206dea43941560a29c9a1105ae3055740ab80aa Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 22 Jul 2013 12:03:35 +0200 Subject: schema: extend content_package_index We can avoid a b-tree sort in the package comparison of the web app, if the package index, also provides a size. --- schema.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema.sql b/schema.sql index b839a51..e9e0bcc 100644 --- a/schema.sql +++ b/schema.sql @@ -2,7 +2,7 @@ CREATE TABLE package (id INTEGER PRIMARY KEY, name TEXT UNIQUE, version TEXT, ar CREATE TABLE content (id INTEGER PRIMARY KEY, pid INTEGER, filename TEXT, size INTEGER, FOREIGN KEY (pid) REFERENCES package(id) ON DELETE CASCADE); CREATE TABLE hash (cid INTEGER, function TEXT, hash TEXT, FOREIGN KEY (cid) REFERENCES content(id) ON DELETE CASCADE); CREATE TABLE dependency (pid INTEGER, required TEXT, FOREIGN KEY (pid) REFERENCES package(id) ON DELETE CASCADE); -CREATE INDEX content_package_index ON content (pid); +CREATE INDEX content_package_size_index ON content (pid, size); CREATE INDEX hash_cid_index ON hash (cid); CREATE INDEX hash_hash_index ON hash (hash); -- cgit v1.2.3