List:General Discussion« Previous MessageNext Message »
From:<sinisa Date:July 25 1999 9:59am
Subject:MySQL query optimisation
View as plain text  
Vladislav Malyshkin writes:
 > 
 > Hi,
 > Does MySQL do the optimization
 > by not calling CONCAT 5 times in the following QUERY,
 > which I use to check for the keywords.
 > 
 > SELECT * from table_x WHERE
 > id=34 AND y=67 AND
 > (FIND_IN_SET('word1',CONCAT(field_1,field_2))>0 OR
 >  FIND_IN_SET('word2',CONCAT(field_1,field_2))>0 OR
 >  FIND_IN_SET('word3',CONCAT(field_1,field_2))>0 OR
 >  FIND_IN_SET('word4',CONCAT(field_1,field_2))>0 OR
 >  FIND_IN_SET('word5',CONCAT(field_1,field_2))>0)
 > 
 > It looks like no, but may be I am wrong.
 > This some times creates a problem because SQL does not have local variables.
 > 
 > Vladislav
 > 
 > 

Hi Vladislav !

How could MySQL do an optimization on your query. It can not optimize
a query regarding keys nor to figure out a better way of fixing your
query.

We are not yet that advanced !!!

Regarding variables in SQL, they may come ....

Sinisa

+----------------------------------------------------------------------+
| TcX  ____  __     _____   _____  ___     ==  mysql@stripped            |
|     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic          |
|    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sinisa@stripped|
|   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaka, Cyprus             |
|  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____                             |
|  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^                            |
|             /*/             \*\                Developers Team       |
+----------------------------------------------------------------------+


Thread
MySQL query optimisationVladislav Malyshkin24 Jul
  • MySQL query optimisationsinisa25 Jul
    • Re: MySQL query optimisationBenjamin Pflugmann26 Jul
  • Re: MySQL query optimisationVladislav Malyshkin26 Jul