List:General Discussion« Previous MessageNext Message »
From:Sergei Golubchik Date:December 5 2003 2:53pm
Subject:Re: fulltext search speed issue with SQL_CALC_FOUND_ROWS
View as plain text  
Hi!

On Dec 04, tk wrote:
> Hello,
> 
> Thanks for the response. 
> There is one thing that is not clear however. 
> 
> Regardless of whether or not I perform the fulltext
> search with or without the SQL_CALC_FOUND_ROWS
> keyword, the results that I get are exactly the same. 
> 
> Also, the notion of stopping after the limit is
> reached cannot apply in the fulltext search or
> otherwise we would only get the first 10 matches but
> not the first 10 "most relevant" matches. This leads
> me to believe that the fulltext search must be looking
> at all the rows in both cases since it otherwise would
> not find the same first 10 most relevant records.
> Hence the question why there should be a difference in
> time.

The difference is that you only need to read 10 rows from the disk
without SQL_CALC_FOUND_ROWS.

With SQL_CALC_FOUND_ROWS MySQL goes on and reads all rows, it takes
time.

Finding relevant rows and sorting is based on index only, row data are
not read.
 
Regards,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Senior Software Developer
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
       <___/  www.mysql.com
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