On Thursday, 27. June 2002 21:26, [EMAIL PROTECTED] wrote:
Hi,

> I apologize for not being more specific. The query that is taking too long
> is :
> SELECT * FROM Stories WHERE UCASE(Path) LIKE 'toUpper(path)%';
> Path is a 255 char field with an index on it. path is variable passed in.
> Thanks again.
>
Of course this query needs time, cause it doesn't use an index. How should 
MySQL uses the Index on Path, when you need UCASE(Path). You can't use an 
index in a where clause with a function on column.

To see if an index is used or not, use the EXPLAIN SELECT ... statement.

Regards

Georg

mysql, query


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to