2014年3月16日

mysql "ON DUPLICATE KEY UPDATE" 语法

摘要: 如果在INSERT语句末尾指定了ON DUPLICATE KEY UPDATE,并且插入行后会导致在一个UNIQUE索引或PRIMARY KEY中出现重复值,则在出现重复值的行执行UPDATE;如果不会导致唯一值列重复的问题,则插入新行。 例如,如果列 a 为 主键 或 拥有UNIQUE索引,并且包含值1,则以下两个语句具有相同的效果: 1INSERT INTO TABLE (a,c) VALUES (1,3) ON DUPLICATE KEY UPDATE c=c+1;2UPDATE TABLE SET c=c+1 WHERE a=1; 如果行作为新记录被插入,则受影响行的值显示1;如果原. 阅读全文

posted @ 2014-03-16 21:55 Still water run deep 阅读(153) 评论(0) 推荐(0) 编辑

Any gotchas at all with converting from MyISAM to InnoDB?

摘要: Q:I'm ready to move from MyISAM to InnoDB but wanted to know if there was a full list of things to look for? For example, I haven't seen any list mention that running DISABLE KEYS on an InnoDB table will throw a warning, except the manual page for ALTER TABLE. It's that kind of thing I n 阅读全文

posted @ 2014-03-16 21:54 Still water run deep 阅读(255) 评论(0) 推荐(0) 编辑

bulk_insert_buffer_size and InnoDB

摘要: Q:I read the following on this pagehttp://dev.mysql.com/doc/mysql/en/server-system-variables.htmlbulk_insert_buffer_size MyISAM uses a special tree-like cache to make bulk inserts faster for INSERT ... SELECT, INSERT ... VALUES (...), (...), ..., and LOAD DATA INFILE. This variable limits the size o 阅读全文

posted @ 2014-03-16 21:17 Still water run deep 阅读(5076) 评论(0) 推荐(0) 编辑

MySQL DELAY_KEY_WRITE Option

摘要: delay_key_writeThis option applies only to MyISAM tables. It can have one of the following values to affect handling of the DELAY_KEY_WRITE table option that can be used in CREATE TABLE statements.If DELAY_KEY_WRITE is enabled for a table, the key buffer is not flushed for the table on every index u 阅读全文

posted @ 2014-03-16 20:29 Still water run deep 阅读(464) 评论(0) 推荐(0) 编辑

More on understanding sort_buffer_size

摘要: There have been a few posts by Sheeri and Baron today on the MySQL sort_buffer_size variable. I wanted to add some more information about this buffer, what is impacted when it is changed, and what to do about it?The first thing you need to know is the sort_buffer_size is a per session buffer. That i 阅读全文

posted @ 2014-03-16 20:02 Still water run deep 阅读(283) 评论(0) 推荐(0) 编辑

myisam_sort_buffer_size vs sort_buffer_size

摘要: Q:I am MySQL on server with 6GB RAM. I need to know what is the difference between myisam_sort_buffer_size and sort_buffer_size?I have following size set to them:myisam_sort_buffer_size = 8Msort_buffer_size = 256MPlease also mention if these values are fine or need adjustments?ThanksA:sort_buffer_si 阅读全文

posted @ 2014-03-16 20:01 Still water run deep 阅读(3113) 评论(0) 推荐(0) 编辑

导航