モノノフ日記

普通の日記です

MySQL ユーザコンファレンス 2008 - MySQL Perfomance Tuning 2

午前のTuning1とは打って変わって難しい内容でした。
各種ストレージエンジンごとに同じ処理でもインデックスや記法を変更して様々な条件下でベンチマークの解説だったんですが、専門用語が多いと同時通訳は結構厳しいですね。きちんと英語が出来ないと辛い、と実感してました。

資料公開を期待したいと思います。

benchmarkスペック

  • All logging off
  • Query cache off
    • 遅延要因になってしまい正確な速度測定にならないから
  • memory buffers "large enough"

Logging Applications

INSERT Log table speed
CPU Usage
  • MyISAMだけ64コネクションで下降する
    • テーブルのロック待ちが多発しているため
  • Archiveは最初からCPU使いまくる
まとめ
  • MyISAM
    • lock contension arounc 64 concurrent connections; idle resources
  • Innodb
    • Transactional consistency costs, only disk bound bottleneck in test
  • Archive
    • Speed star

Index Merge Tests

  • 複数のインデックスを1つとして扱う(?
  • or
  • and
  • and ~ like/between
  • Query UNION << Index_merge Union
Intersect vs. composite index
  • Composite Index > Index Merge
Sort_union vs. Composite Index
  • Composite Index >>> Sort_merge
Date関連のTest
  • NOW()
  • DATE_FORMAT()
  • MONTH('YYYY-MM-DD')
  • DATE_FORMAT(NOW(), '%m')
  • substring()
    • そんなにコストは変わらない
InnoDB Index Merge
  • Insert Buffer
    • SELECTはINSERTされてロック解除された後
  • LOAD DATA INFILEで差がでる
test
  • Summary > Derived > View > Correlated
    • Summaryは更新処理が発生するのがネック
How is a Query really executed
  • Show global status like "handl%"