MySQLMySQLの複合インデックスについて。MySQLを使いこなしている人には常識の範疇にはいる知識だと思うのですが、かつての私のように、知らないとドツボにはまるので、ここにまとめておきます。タイトルでどういう内容か、もしかしたら大体、想像がつくかなと思うのですが、MySQLは1つのクエリーで1つのテーブルに対し、1つのインデックスしか機能しないということです。ようするに、あるテーブルに対して、普通に大量のインデックスを張ってもあまり意味がありません。そこで、今回は、最適な複合インデックスはどのようにしてはることができるか考えていこうじゃないか、という趣旨で書いていきたいと思います。まずは分析。テスト環境でインデックスが使われていないSQLを集めるまずは、/etc/my.cnfのパラメータを以下のように設定し、インデックスが使われていないSQLをスロークエリーに吐き出します。 slow
MySQLのチューニングにおいて非常に重要となるメモリ(バッファ)関連のパラメータについて、 チューニングのポイント DSASのとあるDBサーバ(実メモリ4GB)の実際の設定値 をまとめてみます。 また、必要メモリの総量の計算や限界値を越えてないかチェックしてくれるスクリプトも紹介します。 是非、参考にしてみてください! まず最初に注意点を。 バッファには2つのタイプがあります。 グローバルバッファ スレッドバッファ グローバルバッファはmysqld全体でそのバッファが1つだけ確保されるもので、 これに対し、 スレッドバッファはスレッド(コネクション)ごとに確保されるものです。 チューニングの際にはグローバル/スレッドの違いを意識するようにしましょう。 なぜなら、スレッドバッファに多くのメモリを割り当てると、コネクションが増えたとたんにアッという間にメモリ不足になってしまうからです。 in
2007年5月31日10:53 Tom-Adelstein、Bill-Lubanovic(2007年5月29日(火)) ファイルやディレクトリのバックアップは比較的簡単だが、データベースのバックアップとなると、いくつか特別な工夫を施す必要がある。ここではMySQLを取り上げているが、同じ原理はPostgreSQLやその他のリレーショナルデータベースにもあてはまる。 本稿は、最近O’Reillyから出版された書籍『 Linux System Administration 』の抜粋。 MySQLサーバを休みなく稼働させ続ける必要がないなら、以下に示すような圧縮なしのオフラインバックアップ手法が手っとり早い。 MySQLサーバを停止させる。 # /etc/init.d/mysqld stop MySQLのデータファイルおよびディレクトリをコピーする。例えば、MySQLのデータディレクトリ/var
皆さん、ご無沙汰しております。 パソコン周辺機器にお金をかけはじめている笹亀です。 エンジニアはパソコンが商売道具なので、 やはり使いやすい物を使いたくなるのは自然な事ですね。 ご参考までに。。。 マウス :Logicool MX Revolution(ビックカメラでポイントで購入 キーボード:Bluetooth Mac用キーボード(会社の人から売ってもらいましたw 今回はTriggerについてご紹介したいとおもいます。 Triggerとは、データの変更などのイベントによってあらかじめ指定した処理を自動的に実行する機能です。 最近使用しているデータベースには必ず備えてある機能です。 Oracle,Postgres,MySQLでも当たり前のようにあります。 実際にはどのようなときに使用するものなのでしょうか? ・特定のテーブルに対しての処理のログをとるため ・特定のテーブルのバックアップを
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く