From: Sergei Golubchik Date: December 5 2003 10:37pm Subject: Re: fulltext search speed issue with SQL_CALC_FOUND_ROWS List-Archive: http://lists.mysql.com/mysql/155171 Message-Id: <20031205223702.GE65646@serg.mylan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer /_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany <___/ www.mysql.com