On Thu, Sep 5, 2013 at 7:59 PM, Ross Berteig <r...@cheshireeng.com> wrote:
> Mitigating the long hex problem for me is the fact that none of my > projects have lasted long enough to grow to the point were using more than > 4 to 6 digits of hash prefix feels dangerous. > i'm not 100% sure my query is right (i'm no SQL guru), but in the mail fossil repo we seem to have only 14 collisions (across 21k blobs) at 6 digits: sqlite> create temp table xxx as select count(*) n, substr(uuid,1,6) u from blob group by u; sqlite> select * from xxx where n>1; 2|6fdf52 2|8d712d 2|940431 2|b652b9 2|ba837f 2|bdbf14 2|be32eb 2|c1b1ba 2|c8735d 2|d07537 2|d43165 2|e980ba 2|ef17fb 2|f94f7e sqlite> select count(*) from xxx where n>1; 14 8 digits seems to be the magic number: sqlite> create temp table xxx as select count(*) n, substr(uuid,1,10) u from blob group by u; sqlite> select count(*) from xxx where n>1; 0 sqlite> drop table xxx; sqlite> create temp table xxx as select count(*) n, substr(uuid,1,8) u from blob group by u; sqlite> select count(*) from xxx where n>1; 0 sqlite> drop table xxx; sqlite> create temp table xxx as select count(*) n, substr(uuid,1,7) u from blob group by u; sqlite> select count(*) from xxx where n>1; 1 sqlite> create temp table xxx as select count(*) n, substr(uuid,1,6) u from blob group by u; sqlite> select count(*) from xxx where n>1; 14 -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal
_______________________________________________ fossil-users mailing list fossil-users@lists.fossil-scm.org http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users