From: Date: July 24 1999 3:52pm Subject: MySQL query optimisation List-Archive: http://lists.mysql.com/mysql/8317 Message-Id: <3799E12A.1B14AEA8@mail1.nai.net> MIME-Version: 1.0 Content-Type: text/plain; charset=x-user-defined Content-Transfer-Encoding: 7bit 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