Submit Search
Upload
RDBのインデックスについて.pptx
•
Download as PPTX, PDF
•
0 likes
•
46 views
Tetsuro Nagae
Follow
RDBのインデックスについて説明します。
Read less
Read more
Software
Report
Share
Report
Share
1 of 10
Download now
Recommended
オブザーバビリティ、OpenTelemetryについて.pptx
オブザーバビリティ、OpenTelemetryについて.pptx
Tetsuro Nagae
MySQL SQL tuning
MySQL SQL tuning
Tetsuro Nagae
Hoare論理
Hoare論理
Tetsuro Nagae
Purely functional data structures 8.2 日本語での説明
Purely functional data structures 8.2 日本語での説明
Tetsuro Nagae
Blueprintsについて
Blueprintsについて
Tetsuro Nagae
purely functional data structures 5.3 日本語での説明
purely functional data structures 5.3 日本語での説明
Tetsuro Nagae
Purely Functional Data Structures ex3.3 leftist heap
Purely Functional Data Structures ex3.3 leftist heap
Tetsuro Nagae
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Recommended
オブザーバビリティ、OpenTelemetryについて.pptx
オブザーバビリティ、OpenTelemetryについて.pptx
Tetsuro Nagae
MySQL SQL tuning
MySQL SQL tuning
Tetsuro Nagae
Hoare論理
Hoare論理
Tetsuro Nagae
Purely functional data structures 8.2 日本語での説明
Purely functional data structures 8.2 日本語での説明
Tetsuro Nagae
Blueprintsについて
Blueprintsについて
Tetsuro Nagae
purely functional data structures 5.3 日本語での説明
purely functional data structures 5.3 日本語での説明
Tetsuro Nagae
Purely Functional Data Structures ex3.3 leftist heap
Purely Functional Data Structures ex3.3 leftist heap
Tetsuro Nagae
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
More Related Content
Featured
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
Featured
(20)
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
How to have difficult conversations
How to have difficult conversations
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The six step guide to practical project management
The six step guide to practical project management
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
RDBのインデックスについて.pptx
1.
RDBのインデックスについて
2.
はじめに • RDBに対しSQLを効率よく実行するにはインデックスを正しく使うことが 重要です。 例. 50万件のテーブルでWHERE条件を指定してSELECTする場合 •
今回はRDBのインデックスについてご紹介します。 0 10 20 30 インデックスなし インデックスあり 処理時間(sec) 処理時間(sec)
3.
RDB (復習) • RDBとはすべてのデータを表(テーブル)形式(行と列)で表現するデー タ管理方式を持つデータベースです。 •
リレーショナルデータベースの“リレーション”とはテーブル同士の関係 を設定し、関連付けるものです。
4.
RDBのインデックスについて • インデックスの最も重要な目的は、インデックスを張ったデータに対して順序をつけ てアクセスできるようにすることです。 • データベースは、インデックス
リーフノードを連結するのに、双方向連結リストを使い ます。各リーフノードは、データベースブロックあるいはページと呼ばれる、データ ベースが扱える最小の格納単位に保存されます。リーフノードには、カラムの値と、 ROWID(テーブル内の行に対しその行を特定する”アドレス”)が格納されます。 図. インデックスフリーノードと対応するテーブルのデータ
5.
Bツリー (B-tree) • Bツリーの構造
(B-tree Structure) (※ B-treeの’B’は’Balanced’のBです) 上の図は、要素が30個あるインデックスの例を表しています。双方向連結リストに よって、リーフノード間の論理的な順序が表現されています。ルートノードとブランチ ノードによって、リーフノード間の素早い検索ができるようになっています(後述)。 リーフノードの最大値がブランチノードに載ります。
6.
Bツリーの走査 • Bツリーの走査 (B-Tree
Traversal) 上の図は、Bツリー上でのキー「57」の検索を表します。ツリーの走査は図の左側の ルートノードから始まります。各エントリが、検索する値「57」以上(>=)であるかどうか を確認します。この図では、エントリ83がそれにあたります。データベースは、対応す るブランチノードへのポインタをたどり、ツリーの走査がリーフノードに達するまで同 じ手順を繰り返します。この走査により検索を高速に行えます。 ルートノード ブランチノード リーフノード
7.
複合インデックス (1) • 複合インデックス(複数列にまたがるひとつのインデックス)
は、例えば以下のように SQLのWHERE句の中のカラムと複合インデックスのカラムが一致しているときに効果 を発揮します。 • 例. SELECT first_name, last_name FROM employees WHERE employee_id = 123 AND subsidiary_id = 20; ← これがすぐに見つかる (インデックスにおいては employee_idでソートされ、 employee_idが同じ値をもつ行で subsidiary_idがソートされているため) 複合インデックス ブランチノード ブランチノード リーフノード
8.
複合インデックス (2) • 注意点として、複合インデックスは2つ目以降のカラムだけで使用できません。 例.
このクエリーだと複合インデックスの2つ目のカラムをWHERE句で単独で使ってい るためインデックススキャンにはなりません。 SELECT first_name, last_name FROM employees WHERE subsidiary_id = 20; subsidiary_id=20としてアク セスできるエントリーはまと まっていない (インデックスにおいては employee_idでソートされ、 employee_idが同じ値をもつ 行でsubsidiary_idがソートさ れているため) 複合インデックス ブランチノード ブランチノード リーフノード
9.
まとめ • インデックス • Bツリー •
Bツリーの走査 • 複合インデックス
10.
参考文献 • https://use-the-index-luke.com/ja 開発者のためのSQLのチューニン グへのガイド
Download now