June 20, 2013

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

… and the performance but with a small cost. Queries like INSERT … ON DUPLICATE KEY UPDATE produce gaps on the auto_increment column. To…) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uniqname` (`name`) ) ENGINE=InnoDB; Insert a value using a LEFT OUTER JOIN: insert into foo(name) select…

Comment: SysBench - benchmark tool

… certain occasions i receive follwong primary key violation messages… ALERT: failed to execute SQL query: `INSERT INTO sbtest values(5694934,0,’ ‘,’aaaaaaaaaaffffffffffrrrrrrrrrreeeeeeeeeeyyyyyyyyyy… SQL Server Driver][SQL Server]Violation of PRIMARY KEY constraint ‘PK__sbtest__7C8480AE’. Cannot insert duplicate key in object ‘dbo.sbtest’. First i thought…

Post: How many partitions can you have ?

… got data inserted to them per insert statement. As I tested the UPDATE path on INSERT OF DUPLICATE KEY UPDATE (adding ON DUPLICATE KEY UPDATE set c=c+1 to my bulk inserts) the regression became even larger. 1 partition insert

Comment: INSERT ON DUPLICATE KEY UPDATE and summary counters.

…=InnoDB INSERT IGNORE INTO test (md5) values (‘A’) 1 row affected INSERT IGNORE INTO test (md5) values (‘A’) Duplicate entry ‘A’ for key ‘md5… row which generated the duplicate key error. This would save us a select statement (either before or after the insert) to determine which… answer (why not just use on duplicate key update?) Well this is because i want “on duplicate key return unique_row_id” Cheers //Steve

Post: Conflict Avoidance with auto_increment_increment and auto_increment_offset

insert in table with auto_increment column you will almost for sure get duplicate key error in replication thread if you happen to insert… as well as insertion to the table with unique keys and non auto increment primary keys. The problem is duplicate key error is one of… is not found in addition to duplicate key errors, if you set slave_exec_mode=IDEMPOTENT both duplicate key error and row not found…

Comment: INSERT ON DUPLICATE KEY UPDATE and summary counters.

key) is duplicate or not,if it duplicate then update the record else insert that LAN No. I did it in the following way. insert… viewromappingfinal on duplicate key update LAN=values(LAN) it’s working fine if i won’t use romappingfinalid(table primary key). Suggest me how to use the INSERT ON UPDATE KEY using a table primary key but checking the condition on another primary key

Post: Percona Toolkit 2.1.9 is ready

…-5528-changelog/) fixed a bug: “Added warnings for duplicate key errors when using INSERT IGNORE”. However, standard MySQL does not warn in this… intended to ignore duplicate entry errors by using “INSERT IGNORE”, it now handles the MariaDB case by also ignoring duplicate entry errors in…

Comment: INSERT ON DUPLICATE KEY UPDATE and REPLACE INTO

…) mysql> insert into p values (1,1), (2,2); Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> insert into c values (1,1), (2,2); Query…) — We lost the child #1. mysql> insert into p (id, notid) values (2,20) on duplicate key update notid=20; Query OK, 2…

Post: The story of one MySQL Upgrade

… seen causing upgrade problems in number of other environments. INSERT ON DUPLICATE KEY UPDATE had a unfair share of replication issues in MySQL… frequently this functionality is used. Happily there are only few INSERT ON DUPLICATE KEY UPDATE query instances, and only one of them into… easy enough to change the single application not to use INSERT ON DUPLICATE KEY UPDATE in this instance so it was done. So…

Comment: INSERT ON DUPLICATE KEY UPDATE and summary counters.

…_query(“INSERT INTO table VALUES (’1′, ’1′)”); 3) Using INSERT .. ON duplicate KEY UPDATE .. mysql_query(“INSERT INTO table VALUES (’1′, ’1′) ON duplicate KEY UPDATE user_hits = user_hits+1 “); So.. which one is recommended? I repeat.. my update rate is higher than the insert