List:General Discussion« Previous MessageNext Message »
From:Matt W Date:December 4 2003 10:49pm
Subject:Re: fulltext search speed issue with SQL_CALC_FOUND_ROWS
View as plain text  
Hi,

Yes, you would have similar results with any query that uses
SQL_CALC_FOUND_ROWS. That's because MySQL has to see how many rows would
be found without the LIMIT. So in your case, it can't just abort the
query after it finds 10 rows. All rows that match the WHERE need to be
found.

You might want to try your fulltext search IN BOOLEAN MODE to see if
that runs any faster. :-)


Hope that helps.


Matt


----- Original Message -----
From: <wassuuuub@stripped>
Sent: Thursday, December 04, 2003 9:13 AM
Subject: fulltext search speed issue with SQL_CALC_FOUND_ROWS


> I have some_table with 100,000 rows and with an
> average of 500 words in some_column of each row. When
> i do a fulltext search on this table using a query
> such as the following, all of my results are under 0.1
> seconds:
>
> SELECT something
> FROM some_table
> WHERE MATCH (some_column) AGAINST ('some_search_term')
> LIMIT 0,10
>
> However, when i add the SQL_CALC_FOUND_ROWS keyword
> like in the following query, some queries take longer
> than 1 minute:
>
> SELECT SQL_CALC_FOUND_ROWS something
> FROM some_table
> WHERE MATCH (some_column) AGAINST ('some_search_term')
> LIMIT 0,10
>
> How can there be a huge difference in speed if both
> queries always return the exact same results?
>
> Thanks,
> TK

Thread
fulltext search speed issue with SQL_CALC_FOUND_ROWSwassuuuub4 Dec
  • Re: fulltext search speed issue with SQL_CALC_FOUND_ROWSMatt W4 Dec
Re: fulltext search speed issue with SQL_CALC_FOUND_ROWStk5 Dec
  • Re: fulltext search speed issue with SQL_CALC_FOUND_ROWSSergei Golubchik5 Dec
    • Re: fulltext search speed issue with SQL_CALC_FOUND_ROWStk5 Dec
      • Re: fulltext search speed issue with SQL_CALC_FOUND_ROWSSergei Golubchik5 Dec
        • Re: fulltext search speed issue with SQL_CALC_FOUND_ROWStk15 Dec
RE: fulltext search speed issue with SQL_CALC_FOUND_ROWSGunnar von Boehn5 Dec