Hi,

For an indexed column, the index is used if the start of the string is used:

LIKE 'a string of text%' may use an index
LIKE '%any old string%' will not, since the start of the string is unknown.

The index will only be used if the server decides that it will be quicker
than a full table scan.

Have you got the results of 'explain select ....' to see if your index is
actually being used.

Regards

Quentin
-----Original Message-----
From: Ryan Hadley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 7 February 2001 12:09
To: [EMAIL PROTECTED]
Subject: RE: Performance issues.


Thanks for the quick response.

The response time is slow... and the mysqld processes are what is hogging up
the system.

We do have indexes on the fields, but from what I understand, when you use a
"LIKE" statement, it rarely uses an index.

-Ryan

-----Original Message-----
From: Kent Hoover [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 06, 2001 5:42 PM
To: [EMAIL PROTECTED]
Subject: Performance issues.


Ryan:

If your response time for this query is slow, it is likely that an INDEX
will help
you. (Read about CREATE INDEX in the MySQL manual.

If you don't already have an INDEX on the keyWord column, create one.

If you can induce your customer/users to type more characters, that
would help.
WHERE keyWord LIKE 'salomi%'  is much better for you than
WHERE keyWord LIKE 's%'    .

NOTE, that if your response time to this query is good, there could be
something
other than MySQL running on your machine that is sucking your CPU dry.
You might be able to spot it by running 'top' 'ps -ef' or whatever
command is
available for your machine.

Cheers,

Kent Hoover




---------------------------------------------------------------------
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


---------------------------------------------------------------------
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

The information contained in this email is privileged and confidential
and intended for the addressee only. If you are not the intended 
recipient, you are asked to respect that confidentiality and not 
disclose, copy or make use of its contents. If received in error 
you are asked to destroy this email and contact the sender immediately. 
Your assistance is appreciated.

---------------------------------------------------------------------
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