May 26, 2012

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

Using SQL_CALC_FOUND_ROWS defiantly appears to be situational on the query (at least … for the count Data & FOUND_ROWS = .913 1) .90 for the data with SQL_CALC_FOUND_ROWS. No performance impact when using SQL_CALC_FOUND_ROWS 2) .013 for FOUND_ROWS() query

Post: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

When we optimize clients’ SQL queries I pretty often see a queries with SQL_CALC_FOUND_ROWS option used. Many people think, that it is…: mysql> SELECT SQL_NO_CACHE SQL_CALC_FOUND_ROWS * FROM count_test WHERE b = 555 ORDER BY c LIMIT 5; Results with SQL_CALC_FOUND_ROWS are following: for…: 7 seconds for SQL_CALC_FOUND_ROWS. 7+7 seconds in case when two queries used. Filesort: 1.8 seconds for SQL_CALC_FOUND_ROWS. 1.8+0…

Post: SHOW INNODB STATUS walk through

… id 8079, query id 728899 localhost root Sending data select sql_calc_found_rows * from b limit 5 Trx read view will not see… id 8078, query id 728898 localhost root Sending data select sql_calc_found_rows * from b limit 5 Trx read view will not see… id 8077, query id 728897 localhost root Sending data select sql_calc_found_rows * from b limit 5 Trx read view will not see…

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

… a few millions of rows. Something was killing it and I recognized it was SQL_CALC_FOUND_ROWS. After some analysis I found the following: I… pattern ORDER BY column LIMIT small OFFSET huge). When using SQL_CALC_FOUND_ROWS, the query will always need to calculate the complete result… constant in the mean time. So I decided to drop SQL_CALC_FOUND_ROWS. Instead I will do a second query on a (stored…

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

… SELECT SQL_CALC_FOUND_ROWS * FROM count_test WHERE b = 999 ORDER BY c LIMIT 5;”, mysql uses index to determine number of rows to… (because columns are not included in index). I think use SQL_CALC_FOUND_ROWS in queries that use complex where (for example search queries… do the same thing but one with SQL_CALC_FOUND_ROWS just stores number of records before restricting rows. If I am wrong, please clarify…

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

SQL_CALC_FOUND_ROWS * FROM tab WHERE id>600000 LIMIT 10000 00.100s – SELECT * FROM tab WHERE id>600000 LIMIT 10000 02.250s – SELECT SQL_CALC_FOUND_ROWS * FROM tab WHERE id<600000 LIMIT 10000 00.100s - SELECT * FROM tab WHERE id<600000 LIMIT 10000 00.062s - SELECT SQL_CALC_FOUND_ROWS

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

[...] To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS? 事实证明,当查询语句中的WHERE和ORDER的条件有合适的索引,选择两次查询而不是SQL_CALC_FOUND_ROWS [...]

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

sql = “SELECT FOUND_ROWS()”; $rows_count = $this->fetchOne($sql); ?> 后记:这种方法刚开始我…¯¦è§ï¼šhttp://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/ Mysql [...]

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

Hello, I tried the SQL_CALC_FOUND_ROWS/FOUND_ROWS query method vs the select/count() query method, both using … a real table with ~72,000 entries (MYISAM). Result: The SQL_CALC_FOUND_ROWS/FOUND_ROWS method is 90% faster than the select/count() method in…

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

… do a FOUND_ROWS(): SELECT /*! SQL_CALC_FOUND_ROWS */ NULL FROM aaa LIMIT 0 UNION ALL SELECT NULL FROM bbb LIMIT 0 instead of SELECT /*! SQL_CALC_FOUND_ROWS */ * FROM aaa LIMIT 0 UNION ALL SELECT * FROM bbb LIMIT 0; and then SELECT FOUND_ROWS();