Re: Fast LIKE search
No.
To execute that query (as you have written it), it has to read every row, and scan each name until it finds 30 hits. If there are not 30 hits in the table, it will have to read every row.
If 'uxyz' is a 'word', you can add a FULLTEXT index. Then, using
MATCH(name) AGAINST('uxyz' ...)
will run much faster than LIKE.
If you are not willing to go that way, I may be able to give you some slight improvements, but first please provide
* SHOW CREATE TABLE tbl\G
* SHOW TABLE STATUS LIKE 'tbl'\G
* EXPLAIN SELECT ...\G
and surround them with [ code ] and [ / code ]
Subject
Views
Written By
Posted
15263
May 23, 2009 10:09AM
Re: Fast LIKE search
6866
May 24, 2009 12:41PM
5450
May 25, 2009 10:27AM
4303
May 25, 2009 12:58PM
Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.