June 19, 2013

Post: Is your MySQL buffer pool warm? Make it sweat!

… log every query. (See part two for handling massive slow log volume.) The slow logs are served, via HTTP, by mysql_slowlogd…-stdin –dispatcher-plugin thread-pool –thread-pool-threads-count 100 –session-init-query \”set innodb_fake_changes=1\” > /var/log/playback.log… –session-init-query command-line option, we set the option innodb_fake_changes to prevent INSERTs, UPDATEs, and DELETEs from corrupting…

Post: COUNT(*) for Innodb Tables

… guess note number one about MyISAM to Innodb migration is warning what Innodb is very slow in COUNT(*) queries. The part which I often however see omitted is fact it only applies to COUNT(*) queries… to remove. So remember Innodb is not slow for ALL COUNT(*) queries but only for very specific case of COUNT(*) query without WHERE clause…

Post: InnoDB: look after fragmentation

…primary key was slow. How slow ? Let me show. The query in question is (Q1): SELECT count(distinct username… +—————————+ | count(distinct username) | +—————————+ | 5903053 | +—————————+ 1 row in set (2 min 8.92 sec) mysql> SHOW STATUS LIKE ‘Innodb

Post: Solving INFORMATION_SCHEMA slowness

… impact server performance dramatically. The cause of majority of this slowness is not opening and closing tables, which can be solved…_schema.tables; +———-+——————+ | count(*) | sum(data_length) | +———-+——————+ | 130 | 2856365892 | +———-+——————+ 1 row in set (1.08 sec) mysql> set global innodb_stats_on_metadata=0; Query OK, 0 rows affected (0.00 sec) mysql> select count(*),sum(data_length…

Post: InnoDB Flushing: a lot of memory and slow disk

… 5.5.10 with innodb_adaptive_flushing=ON (default)). The problem here is that the system has quite slow hard drives (2… (and that is an important factor with slow disks); and 3) MySQL does not support innodb_log_file_size > 4GB (it is…. To make the situation even worse, the count of flushed neighbor pages is counted toward the number of pages we asked to…

Post: Why MySQL could be slow with large tables ?

… scan by index: mysql> select count(pad) from large; +————+ | count(pad) | +————+ | 31457280 | +————+ 1 row in…. There are also clustered keys in Innodb which combine index access with data access…is completely disk bound can be very slow. One of the reasons elevating this …

Post: SHOW INNODB STATUS walk through

… piece of information is event counters – “reservation count” and “signal count” show how actively innodb uses internal sync array – how frequently slots are… time object will be free already. OS Waits are relatively slow, and if you get tens of thousands of OS waits… thread is not runniing inside innodb kernel status could be “waiting in InnoDB queue” or “sleeping before joining InnoDB queue”. Latest one is…

Post: A (prototype) lower impact slow query log

… something else.. say an innodb data file, and writing part of your slow query log as an innodb page will not end in…<> implementation. My solution to log file rotation is to basically count how many people may be using it and waiting until… out at the following: straight MySQL (no slow query log): 13 seconds MySQL with slow query log enabled: 18 seconds My audit…

Post: Quickly preloading Innodb tables in the buffer pool

… native support. It would be great if Innodb would implement command to preload table to Innodb buffer pool, which would simply go… you can load Innodb Table Clustered Index in the buffer pool pretty efficiently by using something like SELECT count(*) FROM tbl WHERE non_index_col=0 This works relatively well (though can be slow for fragmented tables…

Post: Optimizing slow web pages with mk-query-digest

… the eXtra benefits from Percona slow query log patch), I knew …total min max avg 95% stddev median # ============ === ======= ======= ======= ======= ======= ======= ======= # Count 0 519 # Exec time 2 … no # String: # Databases prod_db # Hosts localhost # InnoDB trxID 1153145C (2/0%), 11531626 (2/0…