ä»æ´MySQL5.7ãæ±ãã«ããã£ã¦
MySQL5.6ã¨MySQL5.7ã®ãã©ã¡ã¼ã¿å·®åãããããã¦è¦ç´ãã¦ããããshow_compatibility_56ãã¨ããããããã¯ãã®ã¢ã¼ã移è¡æéã«ãããã¡ãªãããã«ãããªååã®ãã©ã¡ã¼ã¿ãããã¾ãã¦ã
ããã¯ä½ï¼
ãSHOW [GLOBAL] STATUSãããSHOW [GLOBAL] VARIABLESãã¨ãããã¨ã¦ããä¸è©±ã«ãªãã³ãã³ããããããã®å®ããã¼ãã«ã«æ ¼ç´ããã¦ããå¤ã表示ãã¦ããããã§ããã¼ãã«*1ããããã¨ãããSELECTæã使ããã¨ã§SHOWã³ãã³ããããããæè»ãªæ¡ä»¶å¼ãªã©ã使ã£ã¦åç §ãã§ããããã§ãã
ãããªãã¼ãã«ãã¡ãMySQL5.6ã¾ã§ã¯Information_Schemaã«ãã£ãã®ããMySQL 5.7ããã¯Performance_schemaã«ç§»åããããã£ã¦ããã¥ã¡ã³ãã«æ¸ãã¦ããã¾ãã
ãã®èª¬æã®ããã«ã¾ãã¾ã1ç¯ã¨ã£ã¦ããã¾ãã
https://dev.mysql.com/doc/refman/5.7/en/performance-schema-variable-table-migration.html
ï¼MySQLã®å
¬å¼ã¯5.7以éã®æ¥æ¬èªããã¥ã¡ã³ããåå¨ããªãã®ã§ãã¡ãã£ã¨ãã©ã¤ãGoogle翻訳ã§é å¼µã£ããï¼
ããããã¨ã®å§ã¾ãã
ãªãã§æ ¼ç´å
ã¹ãã¼ããå¤æ´ã«ãªã£ãã®ãããªãã§ãªãã·ã§ã³æ±ãï¼ã¨ã¯ããããã©ã«ãæå¹ï¼ãªãPerformance_schemaãã«ç§»ããã®ããçç±ã¯ãããããã¾ããã
ããäºå®ã¨ãã¦ã移åãã¦ããããã§ãã
ã§ãMySQL5.6以åã«æ £ãã¦ãã人ã¯ã身ä½ã«æã¿ä»ããInformation_schemaã¸ã®åãåãããæãã¦ãMySQL5.7以éã ã¨ã¨ã©ã¼ã«ãªãããã§ãã
ãããªã¨ãããã®ãªãã·ã§ã³ãshow_compatibility_56ããONã«ãã¦ãããã¨ãInformation_schemaã«ãããã¼ãã«ãSELECTãã¦ãã¨ã©ã¼ã«ãªããã«å¤ãè¿ãã¦ããã¾ãã
ãããperformance_schemaã£ã¦Offã£ããã©ããªãã®ï¼performance_schemaã®On/Offé¢ä¿ãªããInformation_schemaã«ã¯å¾æ¥éããã¼ãã«ããï¼
ããããçåã湧ãã¦ããã®ã§ã調ã¹ã¦ã¾ã¨ãã¦ã¿ã¾ããã
ãã©ã¡ã¼ã¿ã¨æåã®å¯¾å¿é¢ä¿è¡¨
以ä¸ã®è¡¨ã®ããã«ãªã£ã¦ãã¾ãã
performance _schema | show _compatibility_56 | Information _schemaã¸ã®SELECT | Performance _schemaã¸ã®SELECT | SHOWã³ãã³ã |
---|---|---|---|---|
on | on | OK | OK | OK |
on | off | NG | OK | OK |
off | on | OK | OK | OK |
off | off | NG | OK | OK |
ã·ã¹ãã å¤æ°ãperformance_schemaããONã§ããOFFã§ããããPerformance_schemaã¸ã®SELECTãã¨ãSHOWã³ãã³ããã¯å©ç¨å¯è½ã§ãã
ã·ã¹ãã å¤æ°ãshow_compatibility_56ããONã§ããã°ãInformation_schemaã¸ã®SELECTã¯å©ç¨å¯è½ã§ãããéã«OFFãªããä¸åå©ç¨ã§ãã¾ããã
ãªããNGã®éã®ã¨ã©ã¼ã¡ãã»ã¼ã¸ã¯ããUnknown table...ãã§ã¯ãªããã...future is disabled; see the documentaion for 'show_compatibility_56'ãã¨ãªãã¾ãã
show_compatibility_56=OFFã®å ´åãSHOWã³ãã³ãã§ã¯åå¾ã§ããªãå¤ããã
å ¬å¼ããã¥ã¡ã³ãã®åããã¼ã¸ã«æ¸ãã¦ããã¾ãã
The Performance Schema does not collect statistics for Com_xxx status variables in the status variable tables. To obtain global and per-session statement execution counts, use the events_statements_summary_global_by_event_name and events_statements_summary_by_thread_by_event_name tables, respectively.
https://dev.mysql.com/doc/refman/5.7/en/performance-schema-variable-table-migration.html
è¶ è¨³ãCom_xxx statusã¨ããã¼ããevents_statements_summary_global_by_event_name ã¨ã events_statements_summary_by_thread_by_event_name 使ã£ã¦ãï¼ã
ã¨ããããã§ãã©ããªã£ã¦ããã®ãè¦ã¦ã¿ã¦è¦ãããã¾ããããããããã
mysql> select @@version,@@performance_schema,@@show_compatibility_56; +-----------+----------------------+-------------------------+ | @@version | @@performance_schema | @@show_compatibility_56 | +-----------+----------------------+-------------------------+ | 5.7.20 | 1 | 1 | +-----------+----------------------+-------------------------+ 1 row in set (0.00 sec) mysql> select * from information_schema.global_status; ï¼ç¥ï¼ 361 rows in set, 1 warning (0.01 sec) mysql> select * from performance_schema.global_status; ï¼ç¥ï¼ 206 rows in set (0.00 sec) mysql> show global status; ï¼ç¥ï¼ 361 rows in set (0.00 sec) mysql> select @@version,@@performance_schema,@@show_compatibility_56; +-----------+----------------------+-------------------------+ | @@version | @@performance_schema | @@show_compatibility_56 | +-----------+----------------------+-------------------------+ | 5.7.20 | 1 | 0 | +-----------+----------------------+-------------------------+ 1 row in set (0.00 sec) mysql> select * from information_schema.global_status; ERROR 3167 (HY000): The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled; see the documentation for 'show_compatibility_56' mysql> select * from performance_schema.global_status; ï¼ç¥ï¼ 206 rows in set (0.00 sec) mysql> show global status; ï¼ç¥ï¼ 353 rows in set (0.00 sec)
件æ°ã¯ãperformance_schemaãOnã§ãOffã§ãåãã§ããã
ã§ãPerformance_schemaã«Com_xxxç³»ã®è¡ããªãã®ã¯ãã¾ãç解ããã
ããããSHOW ã³ãã³ãã®åºåçµæã8件å°ãªãããã
æ¯è¼ãã¦ã¿ããã³ãããã®ä»¶æ°ã®å·®åã¯
Compression
Last_query_cost
Last_query_partial_plans
Slave_heartbeat_period
Slave_last_heartbeat
Slave_received_heartbeats
Slave_retried_transactions
Slave_running
ã§ããã
ã§ãæ¬é¡ã®ãComç³»ãªãã§ããããã大éã«ã§ã¦ããã®ã§çµæåºåã¯çç¥ãã¾ãããã«ã¦ã³ã¿ãåãã¦ããªãããã¨è¨ã£ã¦ã表示ãããªãããã§ã¯ãªãããã§ãã
Performance_schemaãSELECTããæã¯ãCom_XXXã¯1è¡ããåºã¦ãã¾ãããããããInformation_schemaãSHOWã³ãã³ãã«æ¯ã¹ã¦å¤§å¹
ã«ä»¶æ°ãå°ãªãåå ã
ã§ãé
ç®ã¨ãã¦ã¯Com_XXXãå
¨é¨åºåãããSHOWã³ãã³ãã«ã¤ãã¦ã¯ãæ£ç´è¯ããããããå°ãªãã¨ãCom_SelectããCom_show_statusãªã©ããã®ç¢ºèªã®éã«ä½¿ã£ãã³ãã³ãé¢é£ã®ã«ã¦ã³ã¿ã¯ãshow_compatibility_56ã®ç¶æ
ã«é¢ä¿ãªãã«ã¦ã³ãã¢ãããã¦ã¾ãã
ããã¥ã¡ã³ãä¸ãæ確ã«ã©ããæ©è½ããªããªãã£ã¦æ¸ãã¦ãªãã®ã§ããã°ããåãã¦ã¿ãªãã¨ããããªãã®ããªã
ãããã«ãããshow_compatibility_56ã¯ãã®ãã¡æå³ããªããªããï¼ã£ã¦å®£è¨ããã¦ããã©ã¡ã¼ã¿ãªã®ã§ãæ°ä»æ§åæã§æ±ããããã«ããããã®ã§ãã
ã¾ã¨ã
- MySQL 5.6ã¨MySQL 5.7ã§ãSHOW STATUS/VARIVLESã®åå¾å ã¨ãªããã¼ãã«ã®å ´æãInformation_SchemaããPerformance_Schemaã«å¤ãã£ã¦ãã
- SHOW STATUS/VARIVLESã®ä»£ããã«ããã¼ãã«ç´æ¥åç §ã®SELECT使ãããã©ãMySQL 5.7ããã¯Information_Schemaãè¦ã«è¡ãã¨ã¨ã©ã¼ã«ãªããããPerformance_schemaãè¦ããã
- MySQL 5.7ã«é¢ãã¦ã¯ããshow_compatibility_56=ONãããã¨ãInformation_Schemaå´ãSELECTãã¦ãã¨ã©ã¼ã«ãªããªããªãã
- SHOW [GLOBAL] {STATUS | VARIABLES}使ãã°ãã·ã¹ãã å¤æ°performance_schemaãshow_compatibility_56ã®ç¶æ ã«é¢ä¿ãªãéãã
- Information_Schema.GLOBAL_STATUSã§ã«ã¦ã³ãåãããCom_XXXãã®å¤ã¯ãPerformance_schemaã§ã¯åããªããªããã£ã¦ããã¥ã¡ã³ãã«æ¸ãã¦ãããã©ã詳細ããããï½
ããã¦
- ä»æ´æãããããã調ã¹ããã¨ã¯ã¢ã¦ããããããï¼
ã¨ãããããMySQL 5.7ã«ã¤ãã¦æ°æ©è½ã»å¤æ´ç¹ããã£ããã¢ããããã®ã«ããã®æ¬ã大活èºãã¦ã¾ãï¼ãã¸ããããï¼
詳解MySQL 5.7 æ¢ã¾ãã¬é²åã«ä¹ãé ããªãããã®ãã¯ãã«ã«ã¬ã¤ã (NEXT ONE)
- ä½è : 奥éå¹¹ä¹
- åºç社/ã¡ã¼ã«ã¼: ç¿æ³³ç¤¾
- çºå£²æ¥: 2016/08/26
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- ãã®ååãå«ãããã°ãè¦ã
*1:å ¬å¼ããã¥ã¡ã³ãã§ã¯ãINFORMATION_SCHEMA ãã¼ã¿ãã¼ã¹ã«ã¯è¤æ°ã®èªã¿åãå°ç¨ãã¼ãã«ãå«ã¾ãã¾ãããããã«ã¯å®éã«ã¯ãã¥ã¼ãããã®ã§ãé¢é£ä»ãããããã¡ã¤ã«ã¯ãªããããªã¬ã¼ã¯è¨å®ã§ãã¾ãããã¾ãããã®ååãæã¤ãã¼ã¿ãã¼ã¹ãã£ã¬ã¯ããªãããã¾ããããã¨æ¸ãã¦ããã¾ãããSHOW CREATE TABLEãè¦ãã¨ãCREATETABLE TEMPORARY TABLE ... ENGINE=MEMORYãã¨è¡¨ç¤ºããã¾ãã