June 19, 2013

Post: Avoiding auto-increment holes on InnoDB with INSERT IGNORE

MySQL version 5.1.22 or newer? If so, you probably have gaps in your auto-increment columns. A simple INSERTINSERT IGNORE behaviour using a special mutex table, as explained on Baron’s blog to get… Table: foo Create Table: CREATE TABLE `foo` ( `id` int(11) NOT NULL AUTO_INCREMENT, …

Post: InnoDB Full-text Search in MySQL 5.6: Part 2, The Queries!

…against InnoDB on 5.6.10: mysql: SELECT id, title, MATCH(title, body… OK, now I’m starting to get a little worried. …mysql: SET GLOBAL innodb_ft_server_stopword_table=’test/innodb_ft_list2′; Query OK, 0 rows affected (0.00 sec) mysql: INSERT

Post: Eventual Consistency in MySQL

… (333,444); mysql> INSERT INTO Bar (ID,X,Y) VALUES (21,333,444); mysql> SET FOREIGN_KEY_CHECKS=0; mysql> INSERT INTO Bar (ID,X,Y) …_key_checks.sql | mysql -N | mysql -E *************************** 1. row *************************** test.Bar.ID: 42 DIY RI We can get information about foreign key …

Post: Percona XtraDB Cluster: Multi-node writing and Unexpected deadlocks

mysql> insert into autoinc (j) values (‘node2′ ); Query OK, 1 row affected (0.00 sec) node2 mysql> insert… 1 MySQL thread id 3972, OS thread handle 0x7fddb84e0700, query id 16408 localhost…mysql> commit; ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction node1 mysql

Post: Percona Server on the Raspberry Pi: Your own MySQL Database Server for Under $80

… under $80? Introducing the Raspberry Pi with Percona Server: [caption id="attachment_13122" align="aligncenter" width="582"] Raspberry Pi Fully Connected… have your hardware, here is how to get Percona Server for MySQL up and running: Insert the SD card into a slot on… system (to prevent partial writes), take out the card and insert into your Pi. Carefull, the card goes upside down :) Plug…

Post: The case for getting rid of duplicate “sets”

…,15,15,16) group by val ; +—–+——————–+ | val | count(distinct id) | +—–+——————–+ | -10 | 1 | | -3 | 1 | | -2 | 1 | | 15 | 35417088 | +—–+——————–+ 4 …0.00 sec) mysql> insert into ex2 values (2,1); Query OK, 1 row affected (0.00 sec) mysql> select a.val, …

Post: SHOW INNODB STATUS walk through

… names and lines (which are different in different versions), you get no information what this object is responsible for. You however… 0 sec, process no 3946, OS thread id 1151088992 inserting, thread declared inside InnoDB 500 mysql tables in use 1, locked 1 3… size 368, undo log entries 1 MySQL thread id 9697561, query id 188161264 localhost root update insert into child values(2,2) Foreign key…

Post: Test Drive of Solid

insert into test2 values (1,’Mysql‘),(2,’Solid’),(3,’MyISAM’); mysql> begin; mysql> update test2 set names=’mysql‘ where id=1; Session 2: mysql> begin; mysql> …where id=2; …waiting… Session2: mysql> update test2 set names=’mysql2′ where id=1; ERROR 1213 (40001): Deadlock found when trying to get

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

…_DOC_ID column, however, MySQL apparently has no problem with either of the following statements: mysql> insert into dir_test_innodb3 (fts_doc_id, full_name) values (1, ‘john smith’); mysql> select * from dir_test_innodb3 where fts_doc_id… new FULLTEXT KEY that you create, you’ll get a corresponding FTS_*_DOC_ID.ibd file (but none of the others), and…