select * from mytable where mydescription like '%something%'
For this query, the execution plan doesn't uses the index containing mytable.mydescription, and take near to 68,09 secs (~32 times slower).
Why the "explain" says index use for first query, and a table scan for the second?
Using an index is just like using a dictionary. When you're looking for all words starting with 'in', you will quickly scan the pages to go the entry for 'in'. From then on, you'll read entry by entry until you've reached 'im' and you're done.
If you're looking for all words *containing* 'in', you have no other choice but to start with the first word of the dictionary and to read every entry.
Other kind of indexes are imaginable that keep track of substrings as well (full text searches work that way), but MaxDB doesn't support this.
Daniel Dittmar
-- Daniel Dittmar SAP Labs Berlin [EMAIL PROTECTED]
-- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
