Efficiency of my select statement
Posted by:
john d
Date: April 27, 2010 03:19PM
Which is preferred for efficiency, as I need to search for term ie. boxes in all fields outlined below:
SELECT Title,Description,Program,Producers,Format,Date_Made FROM table1
WHERE id='boxes' OR Program like '%boxes%' OR Title like '%boxes%' OR Producers like '%boxes%' OR Key_Words like '%boxes%'
UNION
SELECT Title,Description,Program,Producers,Format,Date_Made FROM table1
WHERE MATCH(Description) AGAINST('boxes');
or
SELECT Title,Description,Program,Producers,Format,Date_Made FROM table1
WHERE id='boxes' OR Program like '%boxes%' OR Title like '%boxes%' OR Producers like '%boxes%' OR Key_Words like '%boxes%'
AND MATCH(Description) AGAINST ('boxes');
or is there another way altogether i should be looking at this?
Note: Description is the only column defined with a Fulltext index;