May 23, 2012

Post: InnoDB's gap locks

… READ and READ COMMITTED). What is a gap lock? A gap lock is a lock on the gap between index records. Thanks to… table `test`.`t` trx id 72C lock_mode X locks rec but not gap RECORD LOCKS space id 19 page no 4 n… locks to prevent that from happening. 2- innodb_locks_unsafe_for_binlog = 1. Disables the gap locks except for foreign-key constraint checking or duplicate-key

Post: Best kept MySQLDump Secret

…data for table `C` — LOCK TABLES `C` WRITE; /*!40000 ALTER TABLE `C` DISABLE KEYS */; /*!40000 ALTER TABLE `C` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY

Post: Innodb locking and Foreign Keys

… are affecting foreign key relationships. So if you will update any column which is not part of FOREIGN KEY constraint – no foreign key originated locks will happen. However if you update PRIMARY KEY value in the child table the lock will happen…

Post: Instrumentation and the cost of Foreign Keys

… healthy discussions with students about whether or not to use Foreign Key constraints on InnoDB tables.  My standard response has always… NOT NULL, bogus_column char(32), PRIMARY KEY (id), KEY (parent_id), CONSTRAINT child_ibfk_1 FOREIGN KEY (parent_id) REFERENCES parent (id) ) ENGINE…` lock_space: 1300 lock_page: 3 lock_rec: 6 lock_data: 5 2 rows in set (0.00 sec) The same example without the foreign key

Post: SHOW INNODB STATUS walk through

…starting index read mysql tables in use 1, locked 1 LOCK WAIT 3 lock struct(s), heap size 320 MySQL …information we have similar information about last failed foreign key constraint: ———————— LATEST FOREIGN KEY ERROR ———————— 060717 4:29:00 Transaction: TRANSACTION 0…

Post: Heikki Tuuri Innodb answers - Part I

… READ COMMITTED, then InnoDB normally does not lock the ‘gaps’, and it does not lock rows whose latest committed version does not… a foreign key not reference an entire primary key or unique constraint (something that is mandatory in every other RDBMS that suppors foreign key constraints)? Any concrete examples are appreciated. HT: Yes, it is sufficient that a foreign key and the referenced key appear as…

Post: Improved InnoDB fast index creation

…0.000004 | | init | 0.000008 | | Opening tables | 0.000118 | | System lock | 0.000007 | | setup | 0.000027 | | creating table | 0.002255 | …keys that are part of a FOREIGN KEY constraint; mysqldump –innodb-optimize-keys ignores foreign keys because InnoDB requires a full table rebuild on foreign key

Post: Eventual Consistency in MySQL

… can find all foreign keys by querying the INFORMATION_SCHEMA. The KEY_COLUMN_USAGE contains information about both primary keys and foreign keys. If the REFERENCED… and detect orphans early so you can correct them. 1Innodb locking and Foreign Keys 2Instrumentation and the cost of Foreign Keys

Post: Paul McCullagh answers your questions about PBXT

…-level locking and foreign keys. Does this create any additional locking overhead that we should be aware of? Firstly, PBXT does not acquire read locks… to maintain long lists of row-level locks. This is also the case when a foreign key leads to cascading operations which can… is that SELECT … LOCK IN SHARE MODE is currently not supported. When I evaluate a storage engine my key acceptance criteria are…

Post: Ultimate MySQL variable and status reference list

….commanual flush_timeblogpercona.commanual foreign_key_checksblogpercona.commanual ft_boolean_…lock_current_waitsblogpercona.commanual Innodb_row_lock_timeblogpercona.commanual Innodb_row_lock_time_avgblogpercona.commanual Innodb_row_lock_time_maxblogpercona.commanual Innodb_row_lock