Now that we require a match on first or least name to even get close (although I also think an IM account should be pretty much enough to identify an individual), we should probably modify this query to select a matching subset of contact ids, before calculating a score to decide amongst that group.

It should be faster to do "select scores from contacts join address-types group by contactid having ... where contactId in (select subset of ids based on name matching)".