June 19, 2013

Post: Flexviews - part 3 - improving query performance using materialized views

of lines in the order_lines table, three orders of magnitude more quickly than COUNT(*). mysql> select count(*) cnt from order_lines\G *************************** 1. row *************************** cnt: 155187034 1 row in

Post: To SQL_CALC_FOUND_ROWS or not to SQL_CALC_FOUND_ROWS?

two separate queries: one – to get a result set, another – to count total number of rows. In

Post: A workaround for the performance problems of TEMPTABLE views

row in set, 1 warning (0.00 sec) Notice the rewritten SQL querytable: mysql> select * from v2; +——+———-+ | c1 | count(*) | +——+———-+ | 10 | 130 | +——+———-+ 1 row in set (0.01 sec) Notice the vastly different plan over the old one

Post: Shard-Query turbo charges Infobright community edition (ICE)

table). In order to demonstrate the power of Shard-Query it is important to test complex queriesrow in set (0.02 sec) Each year has tens of millions of flights: mysql> select count(*) from ontime_one.ontime_fact; +———–+ | count(*) | +———–+ | 135125787 | +———–+ 1 row in

Post: Is it query which needs to be optimized ?

COUNT 5-10 times faster, sometimes more. This however still works up to certain 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 can often make query slower than two queries

Post: Advanced index analysis with mk-index-usage

tables in a database, so you can query them with SQL. I logged all queriesrows in set (0.00 sec) Here’s how to read this — the first row says that query 1262633894049058504 has two variations. One

Comment: Why MySQL could be slow with large tables ?

of rows with “Bigland” was just 75K rows compared to rows with “ServiceA” which was 50K rows. The initial table (unit) was 100K rows. Each rowONE JOIN extra, with an additional 75K rows to JOIN, the query went from OK to a DISASTER!!!! Then number of rows

Post: How is join_buffer_size allocated?

one is allocated per-join-per-thread, in special cases. A join buffer is allocated to cache rows from each table inquery joins several tables this way, you’ll get several join buffers allocated, for example, this one will have two: select * from a_tablein sql/sql_select.cc intables,uint table_count

Post: Using GROUP BY WITH ROLLUP for Reporting Performance Optimization

of rows which matches our where clause. Most Simple Way Number One is to simply run two queries: mysql> select grp, count… | | 6950 | 290 | +——+———+ 11 rows in set (29.68 sec) Use of extra temporary tablerow in set (0.00 sec) As I forced FileSort execution method for GROUP BY by using SQL

Post: MySQL caching methods and tips

row in any table, the query cache entries for every query which accessed that table must be invalidated. If a frequently executed or expensive querycount of items sold. A query may have to access many millions of rows of