|
|
ru.cgi.perl- RU.CGI.PERL ------------------------------------------------------------------ From : Sergey Tkachuk 2:5040/33.50 20 Aug 2001 16:37:00 To : Pavel Ammosov Subject : Re: вопрос один по MySQL -------------------------------------------------------------------------------- 20 Авг 01 08:09, you wrote to me: PA>>> like давить, like приводит к полному перебору всей таблицы ST>> Если поле проиндексировано, то LIKE 'some%' будет этот индекс ST>> использовать. PA> Hа mysql? А откуда сомнения? =================== Cut =================== *MySQL* also uses indexes for `LIKE' comparisons if the argument to `LIKE' is a constant string that doesn't start with a wildcard character. For example, the following `SELECT' statements use indexes: mysql> select * from tbl_name where key_col LIKE "Patrick%"; mysql> select * from tbl_name where key_col LIKE "Pat%_ck%"; In the first statement, only rows with `"Patrick" <= key_col < "Patricl"' are considered. In the second statement, only rows with `"Pat" <= key_col < "Pau"' are considered. The following `SELECT' statements will not use indexes: mysql> select * from tbl_name where key_col LIKE "%Patrick%"; mysql> select * from tbl_name where key_col LIKE other_col; In the first statement, the `LIKE' value begins with a wildcard character. In the second statement, the `LIKE' value is not a constant. ================= End cut ================= PA> И давно? Hе знаю. Hо думаю, что да. Homer --- * Origin: WWW.LOVEHATE.RU - ВЫСКАЖИСЬ! (2:5040/33.50) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.cgi.perl/32753b80a2e1.html, оценка из 5, голосов 10
|