June 20, 2013

Post: Be careful when joining on CONCAT

column. No matter what I did – forced it to use key, forced a different join order, it did not want to…ORDER BY tb1.title ASC LIMIT 4\G *************************** 1. row *************************** id: 1 select_type: SIMPLE … is converted to its equivalent binary string form; if you want to avoid …

Post: Faster Point In Time Recovery with LVM2 Snaphots and Binary Logs

…   LSize  Origin     Snap%  Move Log Copy%  Convert   lv_root                 VolGroup -wi-ao  5.54g…rows affected (0.49 sec) mysql> alter table employees add column age smallint unsigned not null default 0; Query OK, 300024 rows…can use `lvmsnap.sh snapshot` to create snapshots. The restore…

Comment: Air traffic queries in MyISAM and Tokutek (TokuDB)

… latest version – row-based and column-based. I suspect that fastest compression option (similar to gzip -1) should be used to save CPU time during loading. Don’t know which one is better (row-based or column-based) but it seems really easy to convert

Post: MySQL Prepared Statements

… also can bind direct variables to return columns – which means not only data does not need to be converted back and forth but you also save extra data copying from row structure to your variables. So…

Post: Finding out largest tables on MySQL Server

… | +————————————-+——–+——–+——–+————+———+ 10 rows in set (2 min 29.19 sec) I do some converting and rounding to see number of rows in millions… on counting zeros. The last column shows how much does the index take compared to the data which is mainly…

Post: When is MIN(DATE) != MIN(DATE) ?

……. INDEX `uid` (uid, update_time), INDEX `bar` (some_other_columns) …. ) ENGINE=InnoDB; When he ran this query: SELECT … of zero, whereas doing a CAST() or a CONVERT() on the update_time field first (so that … 00:00:00. But then I decided to move my bogus rows around by changing their PK, and …

Post: Implementing efficient counters with MySQL

…are implemented the most trivial way – they convert read load to write load. When you would simply … to do in this case ? First separate them into special counter table, having say “id” and “counter” columns…course the fact you update short rows also helps. The next problem to deal with is log flushes…

Comment: Fixing column encoding mess in MySQL

Right. I’ve just tested changing the column charset to binary and UTF-8 and can confirm it works fine. … MySQL thinks there’s some other encoding, use CHANGE COLUMN to binary and back to proper encoding. (This is the case that jrabbit… itself is not OK, or if you only need to fix several rows, use CONVERT() tricks. (This is the case which I had…

Post: INSERT ON DUPLICATE KEY UPDATE and summary counters.

…ntoa functions which can convert IP address strings to integers and back. This allows to save on field … in insert clause but this would require to specify list of columns which we skipped for sake of…UPDATE could be different, depending on number of new rows and data set size. 30% speedup should be…

Post: Find unused indexes

…-usage uses EXPLAIN and User Statistics number of rows read for every index. So we’re …-index-usage tries to convert non-SELECT queries to SELECT queries and is not always possible to get a perfect…but your application may need them to avoid duplicates on the column. Take in account that depending on…