TL;DR
-
UMASK環境変数で制御する - ファイルであれば最小パーミッションは
0600, ディレクトリであれば0710の値になる
Ideas, releases, practical guides, and perspectives from the people building with MySQL.
やり方があってるかどうかわからないので違ってたら教えてほしい。
サンプルデータこんな感じ。
mysql80 209534> SELECT * FROM t1 LIMIT 3;
+---------------------+-----------+
| dt | rows_read |
+---------------------+-----------+
| 2022-05-31 17:16:00 | 0 |
| 2022-05-31 17:16:01 | 6 |
| 2022-05-31 17:16:03 | 0 |
+---------------------+-----------+
3 rows in set (0.00 sec)
まずは全期間でrows_readの95%ileを計算してみたい。
パーセンタイルを一発で求めるなにかは無さそうなので、まずはおとなしくRANK()で並べ替える。
mysql80 209534> SELECT dt, rows_read, RANK() OVER (ORDER BY rows_read) AS _rank FROM t1;
+---------------------+-----------+-------+
| dt | rows_read | _rank | …[さらに読む]
メモです。performance_schema.setup_instruments テーブルの比較
MySQL Community Edition (v5.7.38) にしかない instruments
$ diff setup_instruments_aurora.log setup_instruments_community.log | grep '^>' > wait/synch/mutex/sql/LOCK_slave_trans_dep_tracker > wait/synch/mutex/sql/LOCK_keyring_operations > wait/synch/mutex/sql/LOCK_thread_cache > wait/synch/mutex/sql/LOCK_connection_count > wait/synch/mutex/sql/LOCK_thd_remove > wait/synch/mutex/innodb/dict_sys_mutex > wait/synch/mutex/innodb/fts_pll_tokenize_mutex > wait/synch/mutex/innodb/log_sys_write_mutex > wait/synch/mutex/innodb/log_cmdq_mutex > wait/synch/mutex/innodb/page_cleaner_mutex > wait/synch/mutex/innodb/thread_mutex > wait/synch/mutex/innodb/sync_array_mutex > wait/synch/mutex/innodb/row_drop_list_mutex > wait/synch/rwlock/validate/LOCK_dict_file > …[さらに読む]
MySQLリリースノートでわいわい言う勉強会 8.0.29 開催してました。 書き忘れていたので、後日記録として本エントリを記述しています。 mysql.connpass.comhttps://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8.0.29.html togetter.com
以下のエントリーでは、最近の MySQL の Internal Temporary Table の動作についてまとめました。
条件によっては、領域が ディスク上に確保される場合があり、その場合はパフォーマンスに影響がある可能性があります。 今回はMySQLのステータスから Internal Temporary Table の状況を観測し、チューニングする方法をまとめます。
performance_schema.global_status / SHOW GLOBAL STATUS
mysql> SELECT * FROM performance_schema.global_status WHERE VARIABLE_NAME IN ('Created_tmp_tables', 'Created_tmp_disk_tables') ORDER BY VARIABLE_NAME \G
*************************** 1. row *************************** …[さらに読む]
以前、エラーになったクエリがスロークエリログに落ちるかどうか試しました。
このときは文法エラーも含め、エラー時もスロークエリログに記録されてましたが、MySQL 8.0.29, MySQL 5.7.38 で文法エラーは除外するよう挙動が変更されたようです。 改めて、挙動を確認してみます。
MySQL 8.0.29, Statements that cannot be parsed (due, for example, to syntax errors) are no longer written to the slow query log.
実行時間でフィルターされないようlong_query_time=0 を設定して試します。