stop indexing primary key, hashset no sql exists

instead of using the select exists sql notation to see if a link has
been inserted I switched to a hash set which should have a faster
contains method