...

View Full Version : Too many rows for mysql ?



mattis2k
03-15-2007, 01:32 PM
Hi,

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 ?

Thanks

thesavior
03-16-2007, 02: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum