13 messages in com.mysql.lists.mysqlRe: Unique IDs
FromSent OnAttachments
Craig Jackson12 Feb 2004 09:30 
Eamon Daly12 Feb 2004 09:43 
Keith C. Ivey12 Feb 2004 09:47 
Brent Baisley12 Feb 2004 09:50 
Craig Jackson12 Feb 2004 09:57 
Mike Miller12 Feb 2004 10:05 
nala...@owfg.com12 Feb 2004 10:08 
Keith C. Ivey12 Feb 2004 10:15 
Jeff Mathis12 Feb 2004 10:57 
Eri...@ Zomething12 Feb 2004 19:04 
Bill Easton12 Feb 2004 19:56 
Tom Horstmann12 Feb 2004 23:46 
Keith C. Ivey13 Feb 2004 08:51 
Subject:Re: Unique IDs
From:Keith C. Ivey (kei@smokefreedc.org)
Date:02/12/2004 09:47:07 AM
List:com.mysql.lists.mysql

Craig Jackson <cjac@localsurface.com> wrote:

I have a very large web app that uses timestamp for unique IDs. Everything was rolling fine until we started getting many users per second, causing some of the unique IDs to not be unique -- users were being assigned the same timestamp. Since the web app is so large we don't want to change the method of assigning IDs as it would create a major project.

I don't understand. If you're getting many users per second, and your timestamps have 1-second resolution, how could you possibly solve the problem without changing the method of assigning IDs? Are the "many users per second" periods just short bursts, and you're really only getting several hundred users per day? If so, I guess you could keep waiting a second and trying the insert again, but that could lead to indefinite delays if traffic gets high. I think you've got to bite the bullet and change the unique ID to something that's actually unique -- even an AUTO_INCREMENT would work.