I have a varchar column which is too big to make it unique. Is it Ok to hash the value of the column and store the hash in an other varchar column which is unique? Are their sideeffects to this approach or is there even a better one?
Furt开发者_C百科her information: I have to store long titles of articles, books and papers (the longest I found until know is 666 characters long) in utf8 encoding.
If you are able, split the author out in a separate column. Make the index a composite index on hash + author. That way even if you have a hash collission, author should differentiate. If you want to be even more safe, you could add publish date as a 3rd column
精彩评论