View Full Version : Too many rows for mysql ?

03-15-2007, 02:32 PM

I have a large table in mySQL (5 million rows), version 4.1.11

I have the following SQL

SELECT DISTINCT p.product_id, (IF (p.id_from_import = 'remote',8,1) + IF(p.model = 'remote',4,1) + IF (p.source = 'remote',2,1)) as Relevancy FROM product_search p WHERE p.deleted = 'N' AND MATCH (p.search_field) AGAINST ('+remote*' IN BOOLEAN MODE)

Problem is this is taking about 30 seconds to return the records, can anyone think how i can make it better ?


03-16-2007, 03:37 AM
It is the number of if's you are running. If you can cut them back, or do them seperately and pass them to the final query im pretty sure everything will speed up.