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 …) .90 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?

… try to perform some query on this table using indexed column b in where clause: mysql> SELECT SQL_NO_CACHE SQL_CALC_FOUND_ROWS * FROM count… perform this test without indexes (full scan) and with index on b column. Results were following: Full-scan: 7 seconds for SQL_CALC_FOUND_ROWS

Post: SHOW INNODB STATUS walk through

… is command which prints out a lot of internal Innodb performance counters, statistics, information about transaction processing and all kinds of… 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…

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

… WHERE b = 666;”, count is performed on index without access physical data. But in “EXPLAIN SELECT SQL_CALC_FOUND_ROWS * FROM count_test WHERE b… 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…

Post: Four ways to optimize paginated displays

… either a) use SQL_CALC_FOUND_ROWS (see our post on this) or b) execute a separate SELECT to count the rows. There are ways… suggestions for optimizing paginated displays that can give significantly better performance. On the first query, fetch and cache all the results… database. In this model, you get to keep your “found X rows, showing page N of M” display that many people cherish…

Post: Is it query which needs to be optimized ?

… first few rows. This query is not going to be efficient as it needs to traverse a lot of rows to perform group by so for large number of rows you’ve simply got to use… number of rows in result set, with results set of 100.000+ it becomes pretty inefficient. There is surely SQL_CALC_FOUND_ROWS but it…

Post: Are you designing IO bound or CPU bound application ?

… are high) I would highlight this query as possibly having performance problems. Also do not look just at “typical” case – in many cases worst 5% would be responsible for majority of performance problems. Let me illustrate it on simple case. Assuming you… select count(*) from messages where user_id=134 or use SQL_CALC_FOUND_ROWS flag for your main select query. If you’re having…

Post: Bug fix of InnoDB scalability problem

… (without bugfix): select sql_calc_found_rows * from b limit 5; executes for 20 sec (table b contains ~2 mil rows) the same query but… with my own patch I was able to reach better performance. Also as you see there is a thread starvation – last…. So I’d want InnoDB team continue to work on performance improvement. Anyway I think it’s good news.

Comment: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

[...] how you do it. As an example I take the queries from this mysql performance blog article article. Because I’d like to learn what excactly SQL_CALC_FOUND_ROWS [...]