June 19, 2013

Post: Hijacking Innodb Foreign Keys

keys to make it happen: CREATE TABLE `parent` ( `parent_id` int(11) NOT NULL, `v` varchar(10) DEFAULT NULL, PRIMARY KEYkey_checks=1; Query OK, 0 rows affected (0.00 sec) mysql> select * from

Post: Finding out largest tables on MySQL Server

to Information Schema but I still wanted to post little query I use for the purpose so I can easily findprimary key with Innodb tables. Of course it also could be perfectly fine tables but it is worth to look. Changing the query a bit to

Post: Find and remove duplicate indexes

find the three different types of keys explained before. Lets try it: mysql> show create table t; [...] PRIMARY KEY (`i`), KEY `name` (`name`,`i`), KEY `name_2` (`name`), KEY

Post: High-Performance Click Analysis with MySQL

… your primary key correctly. Let’s go back to the ad-by-day table.  If you query date ranges most of the time, you should define the primary key… have the clicks column record the total, and the blue_clicks column record only blue clicks; to find out non-blue clicks you subtract one from the

Post: Find unused indexes

to check the usage of our index from the slow query log. The concept is easy to understand. pt-index-usage reads the slow query log and execute every query

Post: When the subselect runs faster

the rows are large and table does not fit in cache well) When you want to run this query mysql first will try to find

Post: ORDER BY ... LIMIT Performance Optimization

to have sorting column(s) to be in the leading table. If ORDER BY is going by field from the table which is not first in theprimary key while “k” is simply indexes column. Note: In some cases even if it is possible to use index to

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

to me. Why does InnoDB need to add a hidden column (similar to GEN_CLUST_INDEX when you don’t define a PRIMARY KEYto or removed from the table and which need to be merged back into or removed from the main index. I’m not entirely sure about the

Post: Extending Index for Innodb tables can hurt performance in a surprising way

TABLE `idxitest` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `a` int(11) NOT NULL, `b` int(11) NOT NULL, PRIMARY KEY (`id`), KEYquery become so much slower ? The reason is its plan benefits from Innodb specific feature – index entries being sorted by primary key for each complete key

Post: Shard-Query EC2 images available

… shard-query/run_worker to contain the following: #!/bin/bash while [ 1 ] do ./worker >> /dev/null 2>&1 < /dev/null done; Where to find the images… even primary keys). Here is the complete InnoDB schema from one shard. The schema is duplicated 20 times (but not the ontime_fact data): DROP TABLE IF…