AWS Dev Day Tokyo 2018の登壇資料です https://aws.amazon.com/jp/aws-devday-tokyo-2018/
"Nested Loop Joinしか取り上げて無いのにタイトルが大きすぎないか" と指摘を頂いたので、タイトルを修正しました。Merge JoinとHash Joinのことはまた今度書こうと思います。 「JOINは遅い」とよく言われます。特にRDBを使い始めて間がない内にそういう言説に触れた結果「JOIN=悪」という認識で固定化されてしまっている人も多いように感じています。 たしかに、JOINを含むようなSELECT文は、含まないものに比べて重たくなる傾向があることは事実です。また、本質的に問い合わせたい内容が複雑で、対処することが難しいものも存在します。しかし、RDBの中で一体どういうことが起きているのかを知り、それに基いて対処すれば高速化できることも少なくないと考えています。 本稿では、JOINの内部動作を解説した上で、Webサービスを作っているとよく出てくるJOIN SQLを例題に
MySQLのバージョン インストールされたMySQLのバージョンは以下のようになります。 名前 バージョン ダウンロード元 my.cnfサンプル 以下のサンプルを参照して、my.cnfファイルを作成してください。 # このファイルは MySQL 5.6を基準として作られてあります。 # http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html を参照しました。 [mysqld] ##-------------------------------------------------------------------- # mysqldの基本設定 ##-------------------------------------------------------------------- # id は 1 から 2^
前書き - インデックスの作成はなぜ開発者のタスクなのか インデックスの 内部構造 - インデックスは何に似ているか インデックス リーフノード - 二重連結リスト 検索 ツリー(Bツリー) - バランス木 遅いインデックス パートI - インデックスを遅くする2つの原因 where 句 - 検索のパフォーマンスを改善するためにインデックスを作成 等価 演算子 - 一致するキーの検索 プライマリキー - インデックスの使い方を確認 複合インデックス - 複数列に対するインデックス 遅いインデックス パートII - 前の問題点が再び 関数 - where句の 中での関数 大文字・小文字を区別する 検索 - UPPERと LOWER ユーザ定義 関数 - 関数インデックスの制限 インデックスの作り過ぎ - 冗長性の排除法 パラメータ化 クエリ - セキュリティとパフォーマンスのために 範囲 検
SQLのパフォーマンス問題は、SQLそのものと同じぐらいの歴史がある―― ある人は、SQLはそもそも遅いものだとすら言うかもしれません。これは、SQLの歴史が始まった頃は正しかったかもしれませんが、今となっては全く 当てはまらないでしょう。にもかかわらず、SQLのパフォーマンス問題は今も一般的でよくあることです。どうしてそうなってしまうのでしょうか? SQL言語は、恐らく最も成功した第4世代言語(4GL)でしょう。その最大の利点は、「何を」と「どのように」 を分離できることです。SQL文は、どのようにそれを実行するかを記述せずに、単純に 何を必要としているかのみの記述になっています。以下のような例を考えてみましょう。 SELECT date_of_birth FROM employees WHERE last_name = 'WINAND'SQLのクエリは、データを要求する英語の文として読
MySQL Performance Blogの翻訳。Perconaのサポートエンジニアである筆者が、InnoDBのパフォーマンスチューニングの基礎について、ハードウェアやOSの選定からパラメータの推奨値まで解説する。 最近、2007年にPeter Zaitevが書いた「InnoDBパフォーマンス最適化の基礎」という記事を見つけた。これは素晴らしい記事で、読んでいると、MySQLとPercona Serversそして今日利用可能な全ての基盤技術に関して、6年近くの間に何が変わってきたのかを見直してみたいと思わせるものだ。 本当にたくさんのことが変わったものだ!この記事では、InnoDBの使用に効果的なパラメータの多くに、特にパフォーマンスの観点から焦点を当てる。私はサポートエンジニアで、Percona SupportではInnoDBパラメータの適切なサイズに関する質問がたくさん寄せられている
DBサーバでとある日を境にswapが発生していることに気がつきました。 サーバはメモリ32GB搭載していて、そのうちの24GBをinnodb_buffer_pool_sizeに割り当てています。 他のthread毎のメモリ設定値を見てもおかしそうな点はなかったのでググってみました。 MySQL と NUMA アーキテクチャと Swap Insanity MySQL InnoDBストレージエンジンのチューニング(後編) なるほど…。 それぞれのCPUがローカルでメモリを管理しているので、 2CPU積んでいるサーバだと、AというCPUで実行されているスレッドが、BというCPUが確保しているメモリ領域にアクセスするには、AのCPUを経由しないといけないわけですね。 このメモリアクセスが不均一になる方式をNUMAアーキテクチャというみたいです。 NUMAアーキテクチャのメモリ管理が、ノードという単
Twitterは、「MySQL」に施した多くの修正の一部をオープンソース化した。MySQLは、ユーザーによって生成されるデータの大半を保存するためにTwitterが使用しているデータベーステクノロジだ。 Twitterの開発者であるJeremy Cole氏とDavi Arnaut氏はTwitterのエンジニアリングブログの中で、「MySQLは、関心のグラフやタイムライン、ユーザーデータ、ツイート自体といったほとんどのTwitterデータを裏で支える永続ストレージテクノロジだ。われわれは知識共有の価値を信じており、オープンソースソフトウェアは革新を促進すると考えているので、『BSD New』ライセンスの下、MySQLに関するわれわれの成果を『GitHub』でオープンソース化することに決めた」と述べた。 Twitterのチームが公開したコードは、より多くのステータス変数の追加や、大規模なNUM
ついに登場!データベースの操作、作成、管理についての基礎を学習するために最適な教科書 LPI-Japanは、PostgreSQLを体系的に学習するための教材「オープンソースデータベース標準教科書 -PostgreSQL-」を開発し、本サイトにて公開し、無償提供しています。 本教材は、データベースの経験の無い技術者を対象に、実習を通してSQL言語を使ったデータベースの操作、作成、管理についての基礎を学習するための教材が必要とのニーズに応えて開発されました。 データベースを初めて触る方にも分かりやすく、実際に動かしてみて理解できる内容となっています。 また、「OSS-DB技術者認定試験Silver」の学習教材としても役立ちます。 但し、本教材は【受験対策教材ではありません】。受験対策は、LPI-Japan OSS-DB認定教材をご利用ください。 なお、近年のスマートフォンの普及などによる学習環
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く