Create an index on a MySQL column based on the length its contents?
问题 How do I create an index on a column in MySQL v 5.0 (myisam db engine) based upon the length of its value its a TEXT data type up to 7000 characters, do I have to add another column with the length of the first column? 回答1: Yes, as MySQL doesn't support function-based indexes (like ADD INDEX myIndex(LENGTH(text))) , you'll need a new int column and define a trigger to auto-update it after inserts and updates. 回答2: Sounds like a good approach to me (sorry don't know mysql, but in oracle you