diff options
author | Helmut Grohne <helmut@subdivi.de> | 2013-07-23 21:54:41 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2013-07-23 21:54:41 +0200 |
commit | 2f797c9b90f05eadf4bb13f4a9c1f029925d9275 (patch) | |
tree | 08886b100837dc6b8d0d81e08a3ffd619801dad3 | |
parent | 6f88561d726327c90f83b8aad1db26abbd4cdf1e (diff) | |
download | debian-dedup-2f797c9b90f05eadf4bb13f4a9c1f029925d9275.tar.gz |
adapt queries in README to new schema
-rw-r--r-- | README | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -43,12 +43,12 @@ Finding the 100 largest files shared with multiple packages. Finding those top 100 files that save most space when being reduced to only one copy in the archive. - SELECT hash, sum(size)-min(size), count(*), count(distinct pid) FROM content JOIN hash ON content.id = hash.cid WHERE hash.function = "sha512" GROUP BY hash ORDER BY sum(size)-min(size) DESC LIMIT 100; + SELECT hash, sum(size)-min(size), count(*), count(distinct pid) FROM content JOIN hash ON content.id = hash.cid JOIN function ON hash.fid = function.id WHERE function.name = "sha512" GROUP BY hash ORDER BY sum(size)-min(size) DESC LIMIT 100; Finding PNG images that do not carry a .png file extension. - SELECT package.name, content.filename, content.size FROM content JOIN hash ON content.id = hash.cid JOIN package ON content.pid = package.id WHERE function = "image_sha512" AND filename NOT LIKE "%.png"; + SELECT package.name, content.filename, content.size FROM content JOIN hash ON content.id = hash.cid JOIN package ON content.pid = package.id JOIN function ON hash.fid = function.id WHERE function.name = "image_sha512" AND filename NOT LIKE "%.png"; Finding .gz files which either are not gziped or contain errors. - SELECT package.name, content.filename FROM content JOIN package ON content.pid = package.id WHERE filename LIKE "%.gz" AND (SELECT count(*) FROM hash WHERE hash.cid = content.id AND hash.function = "gzip_sha512") = 0; + SELECT package.name, content.filename FROM content JOIN package ON content.pid = package.id WHERE filename LIKE "%.gz" AND (SELECT count(*) FROM hash JOIN function ON hash.fid = function.id WHERE hash.cid = content.id AND function.name = "gzip_sha512") = 0; |