June 20, 2013

Comment: INSERT INTO ... SELECT Performance with Innodb tables.

…, thread declared inside InnoDB 334 mysql tables in use 4, locked 4 3264 lock struct(s), heap size 440760, 799203 row lock(s) MySQL thread id 38, OS thread handle 0x2b3c1c776940, query id 16838101 localhost root Copying to tmp table create table t as SELECT

Post: SELECT LOCK IN SHARE MODE and FOR UPDATE

mysql> commit; Query OK, 0 rows affected (0.01 sec) SESSION2: mysql> select * from tst; Empty set (0.00 sec) mysql> select * from tst lock…missing in Innodb locking.? In my oppinion few rather important peices missing in Locking implementation of Innodb are: Lock table Innodb can lock tables but it …

Post: INSERT INTO ... SELECT Performance with Innodb tables.

Innodb tables perform non locking reads, meaning unless you use some modifiers such as LOCK IN SHARE MODE or FOR UPDATE, SELECT statements will not lock…fetching rows, thread declared inside InnoDB 3 mysql tables in use 1, locked 1 2539 lock struct(s), heap size 224576 MySQL thread id 1794751, query…

Post: Innodb Table Locks

locking table for write (on MySQL Level) before operation and unlocking it straight after. Not so for Innodb. Unless table is being locked explicitly Innodb “converts” table lock

Post: Ultimate MySQL variable and status reference list

MySQL manual, especially the option and variable reference tableInnodb_row_lock_current_waitsblogpercona.commanual Innodb_row_lock_timeblogpercona.commanual Innodb_row_lock_time_avgblogpercona.commanual Innodb_row_lock_time_maxblogpercona.commanual Innodb_row_lock_waitsblogpercona.commanual Innodb

Post: Helgrinding MySQL with InnoDB for Synchronisation Errors, Fun and Profit

MySQL server. Let’s take a recent 5.1 bzr version (pre-5.1.61) and a single test, innodb_plugin.innodbtable_state) (sql_show.cc:6238) ==9090==    by 0x6A5E0C: JOIN::exec() (sql_select.cc:1863) ==9090==    by 0x6A7D72: mysql_select(THD*, Item***, TABLE

Post: InnoDB's gap locks

… a SELECT. They only occur if you do UPDATE or DELETE or SELECT FOR UPDATE. InnoDB provides REPEATABLE READ for read-only SELECT, but… MySQL thread id 3, OS thread handle 0x7f84a78ba700, query id 163 localhost msandbox TABLE LOCK table `test`.`t` trx id 72C lock mode IX RECORD LOCKS

Post: How to find MySQL queries worth optimizing ?

tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0 # InnoDB_trx_id: 12F14 SET timestamp=1347398285; selectmysql> explain select * from sbtest a,sbtest b where a.id=5 and b.id=a.k; +—-+————-+——-+——-+—————+———+———+——-+——+——-+ | id | select_type | table

Post: How FLUSH TABLES WITH READ LOCK works with Innodb Tables

…use FLUSH TABLES WITH READ LOCK to temporary make MySQLSELECT statement to complete in order to complete locking tables. This means if you have workload which includes some very long SELECTInnodb tables and you’re not actively changing users, stored procedures etc (which are stored in MyISAM tables

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

… to MySQL 5.1.22 InnoDB used a method to access that counter values called “Traditional”. This one uses a special table lock called… later the lock algorithm for the auto_increment value is configurable and you can select from different algorithms using the innodb_autoinc_lock_mode…