スロークエリ周りメモ(未定整理
スロークエリ周りメモ(未定整理
https://qiita.com/kkyouhei/items/7dce4815061071b1c01a
-- スロークエリのログを取る
SET GLOBAL slow_query_log = 1;
-- ログ出力先
SET GLOBAL slow_query_log_file = '/tmp/slow_query.log';
-- ログを取るSQL実行時間 下記例だと1秒以上かかっているSQLのログを取得
SET GLOBAL long_query_time = 0;
スロークエリが抽出出来たらそのSQLの先頭にEXPLAINを追加して実行してみる。
MySQLを高速化する10の方法
http://nippondanji.blogspot.jp/2009/02/mysql10.html
■スロークエリの場所
2.my.cnfを見る
my.cnfに設定されてない場合以下のクエリを打ってみる
mysql> show variables like 'slow%';
VagrantとVirtualBoxの環境を整えた際に詰まったことの忘備録
久々にMacのPCでvagrant upを叩くと以下のエラーが出た。
vagrant up
-----------------------
No usable default provider could be found for your system.
Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.
The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.
If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
-----------------------