Can this query be optimised at all?

Caporegime
Joined
18 Oct 2002
Posts
25,287
Location
Lake District
Basically what this query does is take all the keywords from one image then searches the entire db and orders them by weighting, but it takes several seconds each time and is really taxing on the CPU. Any ideas on how to make this faster and more efficient.

Code:
SELECT SQL_CALC_FOUND_ROWS main.*, MATCH(KEYWORDS) AGAINST ('Coast 019390-08 AF Abersoch Activity Beach Beache Boat Britain British Card Coast Coastal Coastline Destination Greeting Horizontal Isle Kingdom Mountain Resort Sailing Sea Seascape Seaside Summer Summery UK United VC08 VW08 Water Welsh West Western Beache Boating Boat Coast Coastal Coastline Coast Resort Sand Seascape Seaside Summery Tidal Tidal Tourism Tourist Touristy Travel Western' IN BOOLEAN MODE) AS score FROM main WHERE MATCH(KEYWORDS) AGAINST ('Coast 019390-08 AF Abersoch Activity Beach Beache Boat Britain British Card Coast Coastal Coastline Destination Greeting Horizontal Isle Kingdom Mountain Resort Sailing Sea Seascape Seaside Summer Summery UK United VC08 VW08 Water Welsh West Western Beache Boating Boat Coast Coastal Coastline Coast Resort Sand Seascape Seaside Summery Tidal Tidal Tourism Tourist Touristy Travel Western' IN BOOLEAN MODE) and ARCHIVED = 0 ORDER BY score DESC LIMIT 32, 32
 
Have done both of those already, the keywords are replicated in the query due to the way Boolean Mode works.
 
The query is different every time though, it depends on the picture that people click the similar link on.
 
Back
Top Bottom