|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Error 1170
Hello,
I am trying to do an index on a tinytext-cell of my mySQL table, since I do quite a lot WHERE LIKE - searches on that one and I guess that should improve the speed, but I keep getting that error message: "#1170 - BLOB column 'text1' used in key specification without a key length" Now I wonder wether anyone of you knows what the prob is, and how I could bypass that prob? best regards, pd |
|
#2
|
||||
|
||||
|
Yes, you need to give the index a length.
Code:
CREATE INDEX index_name
ON tbl_name ( fieldname( 10 ) )
Where '10' is the number of characters in each field to index. Less is better, but depends on what the actual data is. Also note that adding indexes without thinking about it is not a good idea - but you should make sure that the index is useful for your queries. Use the EXPLAIN syntax to do so: Code:
EXPLAIN <your query> --Simon
__________________
|
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Error 1170 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|