3087 件中 231 - 240 件を表示
« 前の 10 件 | 次の 10 件 »
DROP TABLEがどれくらいその他のトラフィックに影響を与えるか……を、手元で測る方法

 

TL;DR

  • sysbenchでDROP用のテーブルと、その他トラフィック用のテーブルをprepareして

  • sysbench runしながらDROP TABLEするだけ

sysbenchは無ければインストール(CentOS 7.xだとepelに入ってる)


$ sudo yum install -y sysbench

ベンチ先がMySQL 8.0の場合、 default_authentication_plugin=mysql_native_password かつ、sysbench用のアカウントがmysql_native_passwordでされてないとエラーになる。


FATAL: error 2059: Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

FATAL: `sysbench.cmdline.call_command' function failed: /usr/share/sysbench/oltp_common.lua:83: connection creation failed

[さらに読む]
MySQLが勝手に作るファイルのパーミッションを指定する

 

TL;DR

[さらに読む]
MySQLだけでWindow関数を使って@rowとか使わずに95%ileを計算したい

やり方があってるかどうかわからないので違ってたら教えてほしい。

サンプルデータこんな感じ。


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 | …
[さらに読む]
今日は、気になってのでMySQLのメタデータロック(MDL)を調べてみたの日。

目次

[さらに読む]
Aurora MySQL と MySQL Community Edition の performance_schema instruments 差分

メモです。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 InnoDB Cluster の座学メモの日。

目次

[さらに読む]
MySQLリリースノート勉強会8.0.29開催してました

MySQLリリースノートでわいわい言う勉強会 8.0.29 開催してました。 書き忘れていたので、後日記録として本エントリを記述しています。 mysql.connpass.comhttps://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8.0.29.html togetter.com

今日は、Percona XtraBackupのMySQLバージョン違いの挙動が気になったの日。

目次

[さらに読む]
最近の MySQL の Internal Temporary Table ステータスとチューニング観点まとめ (version 8.0.28 版)

以下のエントリーでは、最近の MySQL の Internal Temporary Table の動作についてまとめました。

mita2db.hateblo.jp

条件によっては、領域が ディスク上に確保される場合があり、その場合はパフォーマンスに影響がある可能性があります。 今回は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チートシートの日。

目次

[さらに読む]
3087 件中 231 - 240 件を表示
« 前の 10 件 | 次の 10 件 »