Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: Generate unique ids of maximum length

by jonadab (Parson)
on Apr 12, 2010 at 18:01 UTC ( #834331=note: print w/replies, xml ) Need Help??

in reply to Generate unique ids of maximum length

I think you're trying to use the same field for two things: a unique ID, and a human-readable name. You can do that, but there are going to be trade-offs, and one of them is that your unique ID field, in order to remain human-readable, will be longer than would otherwise be necessary. You can use abbreviations up to a point, but eventually you're going to run into "I don't remember what L stands for, was that Lexmark or Luminox or Lenoc or Linksys or what?"

Personally, I would use two fields: a unique ID field (which could just be an auto_increment field if you're storing these in a RDBMS) and a separate human-readable name field that doesn't have to be so short. (You can put a must-be-unique constraint on the name field or not, depending on your preference.)

Just a thought.

  • Comment on Re: Generate unique ids of maximum length

Replies are listed 'Best First'.
Re^2: Generate unique ids of maximum length
by lima1 (Curate) on Apr 13, 2010 at 11:30 UTC
    Whould be cool, yes, but in my case unfortunately not possible. A visualization tool I need for downstream analyses only supports IDs of length 10 or less. So it just makes life easier when the new IDs are close to the old ones.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://834331]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2021-02-26 15:51 GMT
Find Nodes?
    Voting Booth?

    No recent polls found