<?xml version="1.0" encoding="windows-1252"?>
<node id="834331" title="Re: Generate unique ids of maximum length" created="2010-04-12 14:01:12" updated="2010-04-12 14:01:12">
<type id="11">
note</type>
<author id="230012">
jonadab</author>
<data>
<field name="doctext">
&lt;p&gt;I think you're trying to use the same field for two things:  a unique ID, and a human-readable name.  You &lt;strong&gt;can&lt;/strong&gt; 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?"&lt;/p&gt;

&lt;p&gt;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.)&lt;/p&gt;

&lt;p&gt;Just a thought.&lt;/p&gt;</field>
<field name="root_node">
834306</field>
<field name="parent_node">
834306</field>
</data>
</node>
