PDA

View Full Version : How to optimize this query?


student
05-06-2007, 04:53 AM
Hello,
I have a MYSQL database of sites with titles, descriptions etc.

I am getting many slow queries like this:
all these slow queries are only for COUNT( DISTINCT site ).
I am not getting any other slow queries.

-----------
# Sat May 5 08:36:44 2007
# Query_time: 3 Lock_time: 0 Rows_sent: 1 Rows_examined: 401
use downloads_data;
SELECT COUNT(DISTINCT site) FROM table15 WHERE MATCH (site, title, description, keywords, extract) AGAINST ('+home +business' IN BOOLEAN MODE )
----------

I have a fulltext index on this table with - site, title, description, keywords, extract.

site is also unique index. It is a code for each site in my table.

Please inform me how to optmize this query.
Thank you

Velox Letum
05-07-2007, 06:46 PM
Three seconds isn't too bad for a fulltext boolean search. Can you post the EXPLAIN SELECT for that query?