malikah Posted April 11, 2007 Share Posted April 11, 2007 Hi, I'm trying to set an index on 3 of my columns but get this error: #1170 - BLOB/TEXT column 'requirements' used in key specification without a key length The last column in the table is TEXT TYPE containing some large paragraphs. I'm pretty new to all this. Do I need to index all columns? Do I even need an index? How does it improve my database? Thank you. Link to comment https://forums.phpfreaks.com/topic/46536-trying-to-index/ Share on other sites More sharing options...
PC Nerd Posted April 11, 2007 Share Posted April 11, 2007 um, um not sure, but you cant index text types i think also, only index a few fields, often the primary key is bext, and thats all i use it speeds up searching, becauase it orders records by those index, and therefore search can go directly to the criteria, not search the entire database Link to comment https://forums.phpfreaks.com/topic/46536-trying-to-index/#findComment-226535 Share on other sites More sharing options...
rcorlew Posted April 11, 2007 Share Posted April 11, 2007 I only index my id field which is set to int anyway. Makes for quicker queries I think since it is always unique. Link to comment https://forums.phpfreaks.com/topic/46536-trying-to-index/#findComment-226539 Share on other sites More sharing options...
malikah Posted April 11, 2007 Author Share Posted April 11, 2007 um, um not sure, but you cant index text types i think also, only index a few fields, often the primary key is bext, and thats all i use it speeds up searching, becauase it orders records by those index, and therefore search can go directly to the criteria, not search the entire database Hmm.. But what if I was doing this: "SELECT abc, def, ghi FROM table1, table2...." In other words, I'm selecting columns from the middle of the table that aren't primary or indexed? Link to comment https://forums.phpfreaks.com/topic/46536-trying-to-index/#findComment-226544 Share on other sites More sharing options...
PC Nerd Posted April 11, 2007 Share Posted April 11, 2007 doesnt matter if you go SELECT fields FROM table WHERE contition = true then it will still work.. its just indexing can make it slightly faster, but if its not a high load site, then i wouldnt worry too much Link to comment https://forums.phpfreaks.com/topic/46536-trying-to-index/#findComment-226551 Share on other sites More sharing options...
malikah Posted April 11, 2007 Author Share Posted April 11, 2007 doesnt matter if you go SELECT fields FROM table WHERE contition = true then it will still work.. its just indexing can make it slightly faster, but if its not a high load site, then i wouldnt worry too much Cheers, I'll see how it works out. Link to comment https://forums.phpfreaks.com/topic/46536-trying-to-index/#findComment-226560 Share on other sites More sharing options...
PC Nerd Posted April 11, 2007 Share Posted April 11, 2007 if you need more help, PM me Link to comment https://forums.phpfreaks.com/topic/46536-trying-to-index/#findComment-226562 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.