MySQL (InnoDB) ã«ãããè¡ã®ãµã¤ãºã¨é度ã®é¢ä¿ã«ã¤ãã¦
éç´æ¼ç®ãè¡ãã±ã¼ã¹ã§ã¯ãè¡ã®ãµã¤ãºãå°ããä¿ã¤ãã¨ã¯ã¨ã¦ãéè¦ãã¢ã¯ã»ã¹é »åº¦ãä½ãã³ã©ã ã¯å¥ãã¼ãã«ã«è¿½ãåºãã¨ãããã»ãããããããã
ä¸æ¹ãéç´æ¼ç®ãè¡ããªãã±ã¼ã¹ (åä¸è¡ã® insert, update çãå«ã) ã®å ´åã¯ã(ã¯ã©ã¤ã¢ã³ãã¨ã®éä¿¡ã®ããã®) ã·ã¹ãã ã³ã¼ã«ããªã¼ãã¼ãããã«ãªãã®ã§ãå°ããªãã¼ãã«ã«ããããã¢ã¯ã»ã¹ãããããããé·ãè¡ãæã¤ãã¼ãã«ã«ï¼åã¢ã¯ã»ã¹ããã»ããè¯ãã
ãã¨ãã°æå ã®ç°å¢ã§ã® insert on duplicate key update ã®é度ã¯ã
è¡ã®ãµã¤ãº | å¿ è¦æé |
0KB | 1 |
3KB | 4 |
6KB | 7 |
9KB | 13 |
12KB | 13 |
ã¨ããããªæã (ç°å¢ãã¯ã¨ãªã«ããå¤ããã®ã§èªåã§æ¸¬å®ãã¦ãã9KB ã®é度ä½ä¸ã¯ãã¼ã¸ãµã¤ãºã®1/2ãè¶ ããããããª)ãã¤ã¾ããè¡ã®ãµã¤ãºã1KBç¨åº¦ã ã¨ãéä¿¡ã®ãªã¼ãã¼ãããã大ãããããã¾ãåé¡ã«ãªããªãã
ã¾ã¨ãã¦ããã¨ãæé©åããããã¼ãã«è¨è¨ã®åºæ¬ã¯ã
- ã§ããã ãå°æ°ã® SQL ã¯ã¨ãªã§ã¢ã¯ã»ã¹å¯è½ã«ãã
- é«éã«ã¢ã¯ã»ã¹ã§ãããããã¼ãã«åå²ããã
ã¨ããé åºãå¤æ°ã® SQL ã¯ã¨ãªãæããã®ã¯ãä¸è¬çã«ééã£ãæ¦ç¥ããããã㯠MySQL å 㧠join ãããã»ããè¯ãã
2/11 追è¨:ãid:lethevert ãããæ¸ãã¦ãã£ãããããã«ãã¢ã¯ã»ã¹é »åº¦ã«ãã£ã¦ãã¼ãã«ãåå²ãããã¤ã³ããã¯ã¹ãè¨å®ããããããã¨ã§ãHDD ã¸ã®ã¢ã¯ã»ã¹ãæå°åãããã¨ãå¿ è¦ãªã®ã¯ãè¨ãã¾ã§ãããã¾ãã (データベースのレコードサイズ - lethevert is a programmer) ãèªåãæ±ã£ã¦ãã®ãã大é¨åããªã³ã¡ã¢ãªãªãã¼ã¿ãã¼ã¹ã ã£ãã®ã§è§¦ããã®ãå¿ãã¦ãã¾ããorz id:lethevert++