From the course: Advanced SQL for Application Development
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Using B-tree indexes and range scans
From the course: Advanced SQL for Application Development
Using B-tree indexes and range scans
- [Instructor] Let's take a look at B-tree or balanced tree indexes. These are widely used in the kinds of applications that we have been discussing. As the name implies, the B-tree index is a tree data structure with a root, and then several nodes below that. The tree is balanced because the root node is the index value that splits the range of values found in the index column. So for example, if an index column had values from one to 100, then the root would be 50 or close to 50 if there wasn't a 50 in the column. Each side of the tree has a subtree. The top node of the subtree splits the values of the index column so that the values less than the node value are stored to the left branch, and the value is greater than the value of the node are stored in the right. This pattern continues at each level of the tree until we reach the bottom. Now, in this example, the B-tree has 11 nodes storing the values of the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Overview of index types2m 26s
-
(Locked)
Using B-tree indexes and range scans2m 6s
-
Using hash indexes and equality operations1m 32s
-
(Locked)
Covering indexes2m 23s
-
(Locked)
Indexes and bulk data loading2m 18s
-
(Locked)
Avoiding index locks3m 3s
-
(Locked)
Challenge: Define a B-tree and a hash index37s
-
(Locked)
Solution: Defining B-tree and hash indexes57s
-
(Locked)
-
-
-
-
-