June 19, 2013

Post: Using any general purpose computer as a special purpose SIMD computer

… the document size significantly to over 3 million “words” by duplicating the entire set multiple times. mysql> load data infile ‘/tmp…_tmp_39323566` GROUP BY 1,2 ORDER BY 1 ASC ON DUPLICATE KEY UPDATE `word`=VALUES(`word`), `md5(word)`=VALUES(`md5(word)`), `count(*)`=`count…_tmp_27656998` GROUP BY 1,2 ORDER BY 1 ASC ON DUPLICATE KEY UPDATE `word`=VALUES(`word`), `md5(word)`=VALUES(`md5(word)`), `count(*)`=`count…

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 5… this functionality is used. Happily there are only few INSERT ON DUPLICATE KEY UPDATE query instances, and only one of them into table with…

Comment: INSERT ON DUPLICATE KEY UPDATE and summary counters.

…, is the primary key lookup in INSERT INTO…ON DUPLICATE KEY UPDATE faster than the SELECT statement implied in the UPDATE? e.g. UPDATE table SET value=newValue WHERE primary=primaryValue; INSERT INTO table VALUES primaryValue ON DUPLICATE KEY UPDATE value=newValue

Comment: INSERT ON DUPLICATE KEY UPDATE and summary counters.

… affected INSERT IGNORE INTO test (md5) values (‘A’) Duplicate entry ‘A’ for key ‘md5′ I think an incredibly useful feature here would… the innodb row id of the row which generated the duplicate key error. This would save us a select statement (either before… column. Someone will 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: Innodb performance gotcha w Larger queries.

… was replacing single value UPDATE with multiple value REPLACE (though I also saw the same problem with INSERT ON DUPLICATE KEY UPDATE) As I went… time – not the function you would expect to see on top for update workload ! I asked Yasufumi, our Innodb code ninja to… this function so it did not have a bug. INSERT ON DUPLICATE KEY UPDATE, REPLACE, UPDATE all should be affected, though I have not tested…

Comment: INSERT ON DUPLICATE KEY UPDATE and summary counters.

… 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…

Comment: INSERT ON DUPLICATE KEY UPDATE and REPLACE INTO

…); Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> insert into c values (1,1…); Query OK, 2 rows affected (0.00 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> select * from p; +—-+——-+ | id | notid | +—-+——-+ | 1… #1. mysql> insert into p (id, notid) values (2,20) on duplicate key update notid=20; Query OK, 2 rows affected (0.01 sec…

Comment: INSERT ON DUPLICATE KEY UPDATE and REPLACE INTO

…” any updates to the table to a myisam table holding a log of updates. The update table has the same primary key than the primary table. The idea is to keep the last change for every primary key… that I need in the log). The trigger uses INSERT ON DUPLICATE KEY UPDATE to achieve that. The problem is that I find many…

Comment: INSERT ON DUPLICATE KEY UPDATE and summary counters.

[...] use INSERT ON DUPLICATE KEY UPDATE (via MySQL Performance Blog): my $ret = $dbh->do(“INSERT INTO ipstat VALUES(inet_aton(’192.168.0.1′),1,now()) ON duplicate KEY UPDATE hits=hits+1″); Note: ip should be a primary key in this case [...]

Post: Distributed Set Processing with Shard-Query

… via ON DUPLICATE KEY UPDATE is the same. All of the fastest incremental materialized view optimizations can be applied. Shard-Query works only on sets… a UNIQUE CHECK * on the base table: `origin_airport_id` * storage node result set merge optimization enabled: ON DUPLICATE KEY UPDATE `origin_airport_id`=VALUES…