地方エンジニアの学習日記

興味ある技術の雑なメモだったりを書いてくブログ。たまに日記とガジェット紹介。

MySQLで計器を追加で有効化する

UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME LIKE 'memory/innodb/fts%'

こうやれば有効化できる。ちなみに上記はmemoryなのでTIMEDは無視される

SELECT * FROM performance_schema.setup_instruments where NAME LIKE 'memory/innodb/fts%';
+--------------------------+---------+-------+
| NAME                     | ENABLED | TIMED |
+--------------------------+---------+-------+
| memory/innodb/fts0ast    | YES     | NO    |
| memory/innodb/fts0config | YES     | NO    |
| memory/innodb/fts0fts    | YES     | NO    |
| memory/innodb/fts0opt    | YES     | NO    |
| memory/innodb/fts0pars   | YES     | NO    |
| memory/innodb/fts0que    | YES     | NO    |
| memory/innodb/fts0sql    | YES     | NO    |
+--------------------------+---------+-------+

こんなんで確認できる

SELECT event_name,COUNT_ALLOC,HIGH_NUMBER_OF_BYTES_USED FROM performance_schema.memory_summary_global_by_event_name where event_name like '%ft%';
+-----------------------------------+-------------+---------------------------+
| event_name                        | COUNT_ALLOC | HIGH_NUMBER_OF_BYTES_USED |
+-----------------------------------+-------------+---------------------------+
| memory/innodb/fts0ast             |          26 |                       745 |
| memory/innodb/fts0config          |           0 |                         0 |
| memory/innodb/fts0fts             |           0 |                         0 |
| memory/innodb/fts0opt             |           0 |                         0 |
| memory/innodb/fts0pars            |           0 |                         0 |
| memory/innodb/fts0que             |          14 |                       159 |
| memory/innodb/fts0sql             |          16 |                        70 |
| memory/innodb/row0ftsort          |           0 |                         0 |
| memory/myisam/MI_INFO::ft1_to_ft2 |           0 |                         0 |
| memory/myisam/FTB                 |           0 |                         0 |
| memory/myisam/FT_INFO             |           0 |                         0 |
| memory/myisam/FTPARSER_PARAM      |           0 |                         0 |
| memory/myisam/ft_memroot          |           0 |                         0 |
| memory/myisam/ft_stopwords        |           0 |                         0 |
| memory/myisam/SORT_FT_BUF         |           0 |                         0 |
+-----------------------------------+-------------+---------------------------+