MySQL begs to differ:
mysql> EXPLAIN SELECT * FROM test WHERE id = 1 AND tes LIKE '%kdkds%';
+-------+------+---------------+------+---------+------+------+-------+
| table | type | possible_keys | key | key_len | ref | rows | Extra |
+-------+------+---------------+------+---------+------+------+-------+
| test | ref | id | id | 4 | ??? | 3 | |
+-------+------+---------------+------+---------+------+------+-------+
1 row in set (0.01 sec)
On Wed, 6 Oct 1999, Mark Papadakis wrote:
> Hi!
>
> No, it won't work.
> a select * from table where column like 'data%'
> would use the index if properly indexed.
>
> MarkP
>
> Moz wrote:
> >Hello everybody
> >
> >I've just a question:
> >
> >i've created a Table with an index for exemple:
> >
> >CREATE TABLE test (id not null int, tes text,key(id));
> >
> >I've also read that MySQL don't use indexes when you use LIKE
> >argument
> >and the string starts with a wild char.
> >But if I write the follow command:
> >
> >SELECT * FROM test WHERE id=1 AND tes LIKE '%kdkds%'
> >
> >Does the index work in this case ?
> >
>
--
Bob Kline
mailto:bkline@stripped
http://www.rksystems.com