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

On Dec 05, tk wrote:
> Hello Sergei, Gunnar, and others,
> 
> thank you for your quick responses.
> One little mystery remains:
> 
> Why does one need to read all the row data (with
> SQL_CALC_FOUND_ROWS) to get the total number of
> results when using a limit? 
> 
> When the index is used to find relevant rows and sort
> the results, the code certainly must know how many
> total results there are. 

Yes, but it's different code, it works on a different level and knows
nothing about SQL_CALC_FOUND_ROWS :(
 
> Could one not store the total while using the index
> and use "select FOUND_ROWS()" without
> SQL_CALC_FOUND_ROWS to retrieve the total?

Yes, it could.
It is the optimization that wasn't implemented yet.
(but it's in the TODO)

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