title: Methods of using a long varchar key as a lookup key
body: <p>I'm building a commenting mechanism into an application that allows a programmer/plugin author to implement comment threads in a simple manner.</p>
  
  <p>The way I wanted to do this is by using a unique identifier for the comment threads, which took the hard work away from the developer by using a unique key for the thread, where you can place code like this anywhere in the application.</p>
  
  <p>let's say the programmer wanted to add comments to an image upload plugin he calls "my images". In the code he can then call something like:</p>
  
  <pre><code>insertCommentThread('myimages:340');
  </code></pre>
  
  <p>another developer might have a more complicated thing and he wants to add comments to a wiki entry:</p>
  
  <pre><code>insertCommentThread('wiki-entry-page-name-it-could-be-long');
  </code></pre>
  
  <p>So the developer can call the threads any name they like. </p>
  
  <p>I'm a bit worried about the speed of things if the length of the keys will become long, so I'd like to store the keys in some other format.</p>
  
  <h1>So my question is...</h1>
  
  <p><em>Is there a way to store a string key in some encoded way so that it becomes smaller and faster to lookup?</em></p>
  
  <p>(I could hash the strings, but then readability of the database gets lost...)</p>
  
  <p>btw. I'm using MySQL</p>