Full threadjazzido·Postgres users might find Teodor Sigaev's smlar [1] extension useful for this kind of thing. It implements cosine and other similarity metrics.[1] http://sigaev.ru/git/gitweb.cgi?p=smlar.git;a=summaryView on HN