PDA

View Full Version : unique id


BubikolRamios
07-30-2008, 10:20 AM
1. could be date
2. could be autoinc (there is a limit I suppose ?)
3. could be lets say 40 char app generated unique id
4. ......

any comment which is the worst/best regarding eficiency, speed, usefulnes ....

brazenskies
07-30-2008, 11:37 AM
auto incremement an int column.

How many rows do you plan on having? As long as it's not more than 9223372036854775807 then a bigint, autocolumn would suffice!

It all depends what you are using the table for, but generally an auto inc column will always be the best option.

BubikolRamios
07-30-2008, 12:47 PM
this table will contain details from forum posts, so there will be unpredictable amount of records. I could of course have separate counter for each detail
belonging to certain master, but at this point I only see extra unecesary work in it.

brazenskies
07-30-2008, 12:52 PM
So in that case, I'd imagine that there will be many posts to one date, ruining the argument for having date as a unique id.

I ovbiously have no idea of your design but I would still go with a bigint autoInc column. That will allow you to store a silly amount of records. I'd probably guess at Google doesn't even store that many records!

ST-Mike
08-01-2008, 03:44 AM
For that use certainly auto inc int column, there is no need for application generated unique ID's. Date of course is going to cause issues at forums, until you go into miliseconds, but you still can't predict when a user will be making a post. Certainly autoinc.