MySQL ã®ãã¥ã¼ãã³ã°ãã¨è¨ã£ãå ´åã«ã¯ããµã¼ãã¼ãã©ã¡ã¼ã¿ã®èª¿æ´ã EXPLAIN ã³ãã³ããå©ç¨ããã¯ã¨ãªå®è¡è¨ç»ã®æé©åã話é¡ã«ä¸ããã¨ãå¤ãã§ããããããçºè¡ããå ¨ã¦ã® SQL ã«ã¤ãã¦ããã¡ãã¡ EXPLAIN ã³ãã³ãã使ã£ã¦ç¢ºèªãã¦ãã¦ã¯ããããæéããã£ã¦ãããã¾ããããã¥ã¼ãã³ã°ãå¹ççã«é²ããã«ã¯ãã¾ããããã«ããã¯ã¨ãªã£ã¦ãã SQL ã¯ã¨ãªãç¹å®ãã次ã«ãã®æé©åãè¡ãã¹ãã§ãã ã§ã¯ã©ã®ããã«ãã¦ãããã«ããã¯ãç¹å®ããã®ããMySQL Conference & Expo 2009 ã®ãã¼ãã¼ãã«ãã㦠Mark Callaghan æ°ã¯ãGoogle ã§ã¯ SHOW PROCESSLIST ã³ãã³ãã使ã£ãçµ±è¨çã¢ããã¼ãã使ã£ã¦ããã¨è¿°ã¹ã¦ããã£ãããã¾ã (åç §: MySQLConf 09: Mark Callaghan, "This is Not a
MySQL 5.1ã®mysqldumpslowã使ãã¨ãã¥ã¼ãã³ã°ã楽ã«ãªãï¼ã¨ãã話é¡ã§ãã mysqldumpslowã¯ãã¨ãã¨MySQLã«ä»å±ãã¦ãããã¼ã«ã§ãã¹ãã¼ã¯ã¨ãªãã°ãéè¨ãã¦ããããã®ã§ããããèªä½ã¯MySQL 5.1ã§ç¹ã«å¤ãã£ãã¨ããã¯ããã¾ããããã¹ãã¼ã¯ã¨ãªãã°æ¬ä½ã®æ¹ãæ©è½å¼·åããã¦ãããããçµã¿åãããã¨ãªããªã便å©ã«ãªã£ã¦ãã¾ããMySQL 5.1ã«ãããã¹ãã¼ã¯ã¨ãªãã°ã®ä¸»ãªæ©è½å¼·åã¯ä»¥ä¸ã®ä¸ç¹ã§ãã long_query_timeã«1ç§æªæºã®å¤ãè¨å®ã§ããããã«ãªã£ãã åºåå ãè¨å®ã§ããããã«ãªã£ãã ãããã®è¨å®ããªã³ã©ã¤ã³ã§å¤æ´ã§ããããã«ãªã£ãã ããã§ã©ããªããã¨ããã¨ãMySQLã®æ§è½åæããããã¨æã£ãã¨ãã«ããµã¼ããæ¢ããã«ãã®å ´ã§ mysql> set global slow_query_log = 1; mysql> set glob
4.1ã®æ¥æ¬èªåãããããã¥ã¢ã«ã°ããèªãã§ããããã®åä½ã¸ã®è¨åãç¡ãã£ãããè¦è½ãã¦ãããã5.0ã«å¯¾å¿ãããªãªã¸ãã«ã§ããè±èªçã«ã¯ã¡ããã¨æ³¨æãæ¸ãã¦ãã£ãã éçã§ã§not_cachedã°ãããå¢ãã¦ããããã ãããã ãã³ã¼ãå´ã§ã®prepared statementã®å©ç¨ãå¾¹åºããã¦ããã¨ãããã¨ã¯ãããã¯ããã§è¯ãã®ã ãã©ãã©ãããããç¹°ãè¿ãå©ç¨ããªããããªSQLã§ãã©ã¡ã¼ã¿ãåºå®ã®ãã®ã¯prepareããªãã§ãããªãå®è¡ããããã«æ¸ãæãã¦ãã¾ãã¹ãããç¡è«ãInjection対çã«ãªãé¨åãç¡çç¢çæ¸ãæããå¿ è¦ã¯ãªããã ãã©ã æ©è½ã¨ãã¦åããããªå ´æã§åããã®ã ããå調ãã¦åä½ãããã®ãé£ãããã§ã¯ããããæ¬è³ªçã«å ±åä¸å¯è½ãªãã®ã§ã¯ãªãã®ã§å®è£ èªä½ãæ¹åãã¦ãããã¨å¬ããã (追è¨) ããããèããã¨å ±åã¯ããªãé¢åãªå®è£ ã«ãªããããããããPrepared st
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}