title: MySQL query slow with FULLTEXT index
body: <p>I have 1 MyISAM table with 620,000 rows.  Im running XAMPP on a Dual Core Server with 2GB RAM.  Apache is installed as a Windows Service, MySQL is controlled from the XAMPP control panel.</p>
  
  <p>The query below is taking 30+ seconds to run.</p>
  
  <pre><code>select  `id`,`product_name`,`search_price`,`field1`,`field2`,
         `field3`,`field4`
      from  `all`
      where  MATCH (`product_name`) AGAINST ('searchterm')
        AND  `search_price` BETWEEN 0 AND 1000
      ORDER BY  `search_price` DESC
      LIMIT  0, 30 
  </code></pre>
  
  <p>I have a FULLTEXT index on <code>product_name</code>, a BTREE on <code>search_price</code>, auto increment on <code>id</code></p>
  
  <p>If I explain the above query the results are:</p>
  
  <pre><code>id select_type   table type     possible_keys                       key                   key_len ref rows Extra
  1  SIMPLE        all   fulltext search_price,FULLTEXT_product_name  FULLTEXT_product_name 0 NULL 1 Using where; Using filesort
  </code></pre>
  
  <p>How can I speed up this query?  Should it be taking this long on a table of 620,000 rows?</p>
  
  <p>Ive just noticed that this only happens when the database has not been queried for a while, so im guessing this is to do with the cache, the first query is taking 30+ seconds, then if I try a second time the query takes 1 second</p>