June 19, 2013

Comment: How to convert MySQL's SHOW PROFILES into a real profile

Shlomi: I thought about that, but hadn’t gotten around to sending you email yet. No need now :) Anders: I don’t use Windows much, and graphical tools even less often, but… that’s the point of having a lost-time entry; c.f. Cary Millsap for more on this), and 2) it’s…

Comment: MySQL Server Variables - SQL layer or Storage Engine specific.

… a script that does the following: mount none /mnt/hugepages -t hugetlbfs I did that because I saw with the monitoring… system calls. Here you can see the output of strace -c -f -o strace.txt -p 4721 (4721 is the pid of…

Post: Moving Subtrees in Closure Table Hierarchies

…, C-D.  Then add your reflexive path D-D manually. INSERT INTO TreePaths (ancestor, descendant, length) SELECT t.ancestor, ‘D’, t.length+1 FROM TreePaths AS t WHERE t.descendant = ‘C‘ UNION ALL SELECT ‘D’, ‘D… in the subtree.  Suppose A has another child F, and below F we have a subtree D -> E (see illustration): We…

Comment: New patches, new builds

….h if test -f y.output; then \ mv y.output sql_yacc.output; \ fi sed ‘/^#/ s|y\.tab\.c|sql_yacc.cc… && mv sql_yacc.cct sql_yacc.cc sed: can’t read y.tab.c: No such file or directory make[2]: *** [sql…/gen_lex_hash.Tpo” -c -o gen_lex_hash.o gen_lex_hash.cc; \ then mv -f “.deps/gen_lex_hash.Tpo” “.deps/gen_lex_hash.Po”; else rm -f “.deps/gen_lex_hash.Tpo”; exit 1; fi `-mcpu=’ is…

Post: High availability for MySQL on Amazon EC2 – Part 4 - The instance restart script

…” while [ $done == "false" ] do status=`ec2-describe-instances -K $PK -C $CERT $OLD_INSTANCE_ID | /usr/local/bin/filtre_instances.pl…-instances -K $PK -C $CERT $AMI_HA_MYSQL -n 1 -g $HA_SECURITY_GROUP -f $USER_DATA_SCRIPT -t $INSTANCE_TYPE -z $INSTANCE…-instances -K $PK -C $CERT $AMI_HA_MYSQL -n 1 -g $HA_SECURITY_GROUP -f $USER_DATA_SCRIPT -t $INSTANCE_TYPE -z $INSTANCE…

Post: How to recover deleted rows from an InnoDB Tablespace

…NAME=’salaries’; +————+ | ROW_FORMAT | +————+ | Compact | +————+ ~/recovery-tool# ./page_parser -5 -f data/salaries.ibd Opening file: data/salaries.ibd: [...] 71….key. After identifying the Primary Key don’t forget to remove the innodb_table_monitor. C) Check the size on disk …

Comment: Multi Column indexes vs Index Merge

… that I can’t figure out. I have a huge query that is like: where a,b,c,d,e,f pulling from a DB of nearly 5 million records. I can make a multi column index on a,b,c,d,e,f but the query is dynamic. It may search on a,b,e,f or b,d,f. The amount of indexes I would need to…

Post: UDF -vs- MySQL Stored Function

…’, ‘c‘), ‘dd’, ‘d’), ‘ff’, ‘f‘), ‘gg’, ‘g’), ‘ll’, ‘l’), ‘mm’, ‘m’), ‘nn’, ‘n’), ‘oo’, ‘o’), ‘pp’, ‘p’), ‘rr’, ‘r’), ‘ss’, ‘s’), ‘tt’, ‘t…’, ‘c‘), ‘dd’, ‘d’), ‘ff’, ‘f‘), ‘gg’, ‘g’), ‘ll’, ‘l’), ‘mm’, ‘m’), ‘nn’, ‘n’), ‘oo’, ‘o’), ‘pp’, ‘p’), ‘rr’, ‘r’), ‘ss’, ‘s’), ‘tt’, ‘t… really save your day. If you need one and don’t feel confident writing C, you know who to call!

Post: Fun with the MySQL pager command

… few more examples. Discarding the result set Sometimes you don’t care about the result set, you only want to see… – 1 row in set (0.16 sec) Hmmm, checksums don’t match, something is wrong. Let’s retry: # Rewritten query – correct…: mysql> pager awk -F ‘|’ ‘{print $6}’ | sort | uniq -c | sort -r PAGER set to ‘awk -F ‘|’ ‘{print $6}’ | sort | uniq -c | sort -r’ mysql…

Post: Living with backups

… example: /root/backup-tools/tar –read-rate=15000000 -C /mnt/snapshot -c -z -v -f – mysql | ssh backup@storage-host /root/backup-tools… new scheduler: # for device in `ls /sys/block` ; do if [ -f /sys/block/$device/queue/scheduler ] ; then \ echo “cfq” > /sys/block…, or even from quite expected spikes that you simply can’t do anything about. So what I thought could be done…