How a kd-tree is stored (in memory)
The data record is
stored in
the internal nodes !!
Modifying the kd-tree for disk storage
Modification 1:
internal nodes are for
searching only
Modifying the kd-tree for disk storage
Modification 2:
add the equality (=) case to
the right sub-tree
Modifying the kd-tree for disk storage
Modification 3:
only the leaf nodes
will store data
(that's what we want to achieve !)
Example of a kd-tree index for disk
Input data:
Example of a kd-tree index for disk
Input data:
The kd-tree:
Search property of a kd-tree index
All data records
in the left subtree (shaded)
has
salary search key values < 150:
(It's similar to
a Binary Search Tree)
Search property of a kd-tree index
Data records
in this left subtree
has
salary < 150
and
age < 60:
(It's similar to
a Binary Search Tree)
Search property of a kd-tree index
Data records
in this right subtree
has
salary < 150
and
age ≥ 60:
(It's similar to
a Binary Search Tree)
And so on...
Search space partitioning property of a kd-tree index
Search space partitioning property of a kd-tree index
Search space partitioning property of a kd-tree index
Partitioning of the
search space:
❮
❯