June 19, 2013

Post: Quickly preloading Innodb tables in the buffer pool

… mentioned you can load Innodb Table Clustered Index in the buffer pool pretty efficiently by using something like SELECT count(*) FROM tbl WHERE… some non PRIMARY Indexes preloaded you can use something like SELECT count(*) from tbl WHERE index_col like “%0%” for each index… BLOB/TEXT externally stored columns you can use similar query: SELECT count(*) from tbl WHERE blob_col like “%0%”. Note if you…

Post: COUNT(*) for Innodb Tables

… fact it only applies to COUNT(*) queries without WHERE clause. So if you have query like SELECT COUNT(*) FROM USER It will be… for Innodb tables as different transactions may see different number of rows in the table. If you have query like SELECT COUNT(*) FROM IMAGE WHERE USER_ID=5 this query will be executed same way both for MyISAM and Innodb tables…

Post: Efficient Boolean value storage for Innodb Tables

…Create_options: Comment: InnoDB free: 6144 kB *************************** 2. row *************************** Name: cbool Engine: InnoDB Version: 10 …-Aware comparison operator: mysql> select count(*) from cbool where c1NULL; +———-+ | count(*) | +———-+ | 1048576 | +———-+ 1 row in set…

Post: How much memory Innodb Dictionary can take ?

… real system: mysql> select count(*) from INNODB_SYS_TABLES; +———-+ | count(*) | +———-+ | 48246 | +———-+ 1 row in set (8.04 sec) mysql> select count(*) from INNODB_SYS_INDEXES; +———-+ | count(*) | +———-+ | 451773 | +———-+ 1 row in set (2.75 sec) In this case The memory stats from SHOW INNODB STATUS…

Post: How FLUSH TABLES WITH READ LOCK works with Innodb Tables

… | 10219 | root | localhost | dumptest | Query | 324 | Sending data | select count(*) from A,B | 0 | 0 | 2359297 | | 10290 | root…SELECT queries to let backup to proceed, but resolving server gridlock one way or another. If you’re just using Innodb

Post: Copying InnoDB tables between servers

innodb_data_home_dir = ./ xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend xtrabackup: innodb_log_group_home_dir = ./ xtrabackup: innodb… done. When finished quick check mysql> select count(*) from order_line; +———-+ | count(*) | +———-+ | 32093604 | +———-+ 1 row in set (…

Post: Join performance of MyISAM and Innodb

… today which involved benchmarks of Join speed for MyISAM and Innodb storage engines for CPU bound workload, this is when data…` (`i`), KEY `c` (`c`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; select count(t1.pad),count(t2.pad) from t1,t1 t2 where t1.id… data is clustered together with index and generally highly optimized Innodb builds hash indexes which helps to speed up lookup by…

Post: Moving from MyISAM to Innodb or XtraDB. Basics

… time in Innodb you want larger updates to reduce cost of transaction commit. You also may want to avoid excessive SELECT COUNT(*) FROM TBL (with no where clause) which is very fast for MyISAM but does table/index scan for Innodb. Defaults… most important values to check are innodb_flush_log_at_trx_commit, innodb_buffer_pool_size and innodb_log_file_size. There are…

Post: Innodb Fuzzy checkpointing woes

… behavior – Instead of being spread over time at certain time Innodb starts to flush pages very agressively seriously slowing down or… pages. In such case current implementation works just fine – Innodb flush threads selects range of LSN to flush each round which is… IO. One more related problem Innodb has – too many hard coded numbers.  For example Innodb will count number of IOs done to…

Post: InnoDB Full-text Search in MySQL 5.6 (part 1)

…> select * from information_schema.innodb_ft_config; +—————————+———+ | KEY | VALUE | +—————————+———+ | optimize_checkpoint_limit | 180 | | synced_doc_id | 1028261 | | last_optimized_word | | | deleted_doc_count…> select * from information_schema.innodb_ft_config; +—————————+———+ | KEY | VALUE | +—————————+———+ | optimize_checkpoint_limit | 180 | | synced_doc_id | 1032677 | | last_optimized_word | | | deleted_doc_count