0

I am using CreateUUID() to create unique ids for my records but I notice that every once in a while I am ending up with duplicates so I wanted to know what is the probability of such a thing happening and how to avoid it. At the moment I have 300K records on my database and that number will only continue to get bigger.

The UUID has this format 7C26B210-5056-AB52-B9E1B2137830AC36

Geo
  • 3,160
  • 6
  • 41
  • 82
  • http://jochem.vandieten.net/2011/05/05/the-definitive-guide-to-coldfusion-uuids/ – Chris Blackwell Jul 18 '14 at 20:35
  • " I notice that every once in a while I am ending up with duplicates". You are mistaken. If the same UUID is cropping up, it's because you are reusing it unwittingly, not because `createUuid()` has generated duplicates. See here: https://en.wikipedia.org/wiki/Universally_unique_identifier#Random_UUID_probability_of_duplicates. Numbers measured in only the 100s of thousands - as per your situation - are inconsequentially trivial by comparison. You will never see a duplicate. – Adam Cameron Jul 18 '14 at 20:40
  • @AdamCameron it was a mistake in a 'ghost' file that I just found where it was picking up old UUIDs based on some random criteria. But thanks anyway :) – Geo Jul 18 '14 at 20:43

0 Answers0