Database Technology

Learn / Database Technology

DBT: 7 Multidimensional Indexing

Practice questions on multidimensional indexing: Grid Files, kd-Trees, Quad-Trees, R-Trees, bitmap indices, and query types.

Learning path

0%

0 of 10 sections marked complete · about 67 minutes

Learning objectives

What you will be able to explain

  • How many dimensions does a standard physical disk have for arranging data?
  • Is a sparse index 50 times smaller than a dense index in this scenario?
  • What core characteristic is shared between OLAP (Data Warehouse) data and Spatial data?
  • How is a k-Nearest-Neighbor (kNN) query typically executed in a multidimensional index?
  • State whether each statement is True or False:
  • In a Grid File, what does the "Bucket Matrix" (or Grid Directory) store?

Section 01

How many dimensions does a standard physical disk have for arranging data? to What core characteristic is shared between OLAP (Data Warehouse) data and Spatial data?

01

How many dimensions does a standard physical disk have for arranging data?

Although hardware has cylinders/tracks/sectors internally, DBMS access is exposed as a linear sequence of blocks/pages. So from the indexing perspective, physical storage behaves as one-dimensional.

02

Is a sparse index 50 times smaller than a dense index in this scenario?

Dense index pages are N/500 (one entry per record). Sparse index pages are (N/10)/500 = N/5000 (one entry per data page). The size ratio is (N/500)/(N/5000)=10, so the sparse index is 10x smaller, not 50x.

Guided checkpoint

A B+ Tree is used to build a sparse and a dense index for a dataset where 10 records fit on one page and 500 index entries fit on one page.

03

What core characteristic is shared between OLAP (Data Warehouse) data and Spatial data?

Both OLAP and spatial workloads are inherently multidimensional, involving several attributes that may not correlate strongly. That is why specialized multidimensional indexing strategies are needed.

Section 02

How is a k-Nearest-Neighbor (kNN) query typically executed in a multidimensional index? to In a Grid File, what does the "Bucket Matrix" (or Grid Directory) store?

01

How is a k-Nearest-Neighbor (kNN) query typically executed in a multidimensional index?

kNN is commonly implemented by repeatedly expanding a search radius (or equivalent best-first region expansion) until enough nearest candidates are guaranteed. It is not a single hash-style point lookup.

02

State whether each statement is True or False:

1) True: kd-Tree style median splits tend to balance point counts. 2) True: Quad-Trees split geometric space uniformly. 3) False: Grid Files partition coordinate space, not by equal point counts. 4) True: R-Tree grouping is data-driven via object bounding regions.

03

In a Grid File, what does the "Bucket Matrix" (or Grid Directory) store?

The grid directory (bucket matrix) stores references to data buckets for each cell/region in the partitioned space. It is an address structure, not the actual record storage.

Section 03

How many entries are in the bucket matrix? to Which of the following are true regarding Grid File efficiency? (Select all that apply)

01

How many entries are in the bucket matrix?

A 2D grid directory has one entry per stripe combination. With 3 x-stripes and 4 y-stripes, entries = 3 x 4 = 12.

Guided checkpoint

A 2D Grid File has 3 stripes on the X-axis and 4 stripes on the Y-axis.

02

Match the query definition to the correct term:

Rectangle containment is an orthogonal range (box/window) query. Full-coordinate lookup is a point query, while specifying only some dimensions is a partial-match query.

03

Which of the following are true regarding Grid File efficiency? (Select all that apply)

If the directory is memory-resident, a point lookup can reach the target bucket with one bucket I/O (A). Range predicates touch all overlapping cells/buckets (B). In high dimensions, cell count grows combinatorially, often with many empty buckets (C).

Section 04

Compress the following bitmap using the Run-Length Encoding (RLE) method shown in the slides: `11111000011`. to Identify the tree type based on its splitting logic:

01

Compress the following bitmap using the Run-Length Encoding (RLE) method shown in the slides: `11111000011`.

The bitmap `11111000011` has runs: 5 ones, 4 zeros, 2 ones. In the slide format used here, this is encoded as 5-1, 4-0, 2-1 -> `514021`.

02

What is a major disadvantage of Partitioned Hashing compared to other multidimensional indices?

Partitioned hashing can route exact matches efficiently but does not preserve spatial order, so multidimensional range queries degrade because many buckets must be checked.

03

Identify the tree type based on its splitting logic:

Quad-Trees recursively split space into equal quadrants (1-B). kd-Trees split by cycling dimensions and often median values (2-A). R-Trees index overlapping MBR hierarchies (3-C).

Section 05

Which statements are true about R-Trees? (Select all that apply) to What is the primary motivation for using a Hilbert R-Tree?

01

Which statements are true about R-Trees? (Select all that apply)

R-Trees are height-balanced and use MBRs in internal nodes to bound children. Leaves store references to objects/geometries. Because MBRs can overlap, search may follow multiple branches even though each object is stored once.

02

If the root has 100 points, how many points (roughly) will be in each leaf node after 2 levels of splits?

Median split on x divides 100 points into about 50/50. The next level splits each half on y, producing 4 leaves of roughly equal size: 100/4 = 25 points each.

Guided checkpoint

You are building a kd-Tree for 2D points (x, y). The first split is on xx at the median. The second level splits are on yy.

03

What is the primary motivation for using a Hilbert R-Tree?

Hilbert R-Trees map multidimensional objects via Hilbert curve ordering to improve locality and packing. Better packing generally reduces overlap and improves query pruning.

Section 06

State whether each statement is True or False regarding Grid File insertions: to What is the maximum number of bucket I/Os required?

01

State whether each statement is True or False regarding Grid File insertions:

1) True: overflow blocks are one insertion strategy. 2) False: adding a grid line affects multiple matrix cells, not one bucket only. 3) True: refinement can create sparse/empty cells. 4) True: moving a line impacts all buckets intersected by that line.

02

Bitmap indices are most effective for which type of data?

Bitmap indexes are best for low-cardinality categorical attributes because each value gets a bitmap and queries can combine them quickly. High-cardinality values would require too many sparse bitmaps.

03

What is the maximum number of bucket I/Os required?

A range covering 2 columns by 3 rows intersects at most 2 x 3 directory cells, so up to 6 referenced buckets may need to be read.

Guided checkpoint

A Grid File has a 10×1010 \times 10 bucket matrix. A range query covers a 2×32 \times 3 area of this matrix.

Section 07

What are the potential problems with Grid Files as dimensions increase? (Select all that apply) to Match the data layout to its intended use case:

01

What are the potential problems with Grid Files as dimensions increase? (Select all that apply)

Grid directories grow exponentially with dimension count, causing many empty cells and high memory pressure. With enough dimensions, the directory can stop fitting in RAM. Point queries do not inherently become O(N), so C is incorrect.

02

Why can't a B+ Tree efficiently support a 2D range query (e.g., X=5X=5 AND Y=10Y=10)?

A single B+ Tree orders tuples along one key dimension. For predicates on two dimensions, only one can be used for ordered traversal and the other is usually a residual filter, so it is inefficient for true 2D range search.

03

Match the data layout to its intended use case:

Row layout (NSM) is optimized for transactional access to full tuples (OLTP). Column layout (DSM) is optimized for analytics scanning/aggregating a subset of columns (OLAP).

Section 08

True or False: to Decode the following RLE sequence into a bitmap: `312011`.

01

True or False:

1) False: frequent updates are expensive because many bitmaps must be maintained. 2) True: run-length and other schemes compress bitmaps well. 3) True: bitwise AND/OR operations are very fast. 4) True: high cardinality means many per-value bitmaps.

02

In a Grid File, if a distance query finds a candidate point PP' in the starting bucket, but the distance d(P,P)d(P, P') is greater than the distance to the bucket boundary, what must happen?

If the current candidate distance exceeds the distance to a bucket boundary, a closer point may exist in adjacent buckets. Therefore the search region must expand to neighboring buckets.

03

Decode the following RLE sequence into a bitmap: `312011`.

RLE `312011` decodes as 3 ones, 2 zeros, and 1 one, yielding `111` + `00` + `1` = `111001`.

Section 09

Which of the following are mentioned as ways to store spatial data in a relational database? (Select all that apply) to Match the index to its partitioning method:

01

Which of the following are mentioned as ways to store spatial data in a relational database? (Select all that apply)

The slide examples include textual geometry representations such as WKT and explicit latitude/longitude columns. In this quiz's framing, those are the listed relational-storage approaches.

02

What is another name for an "Orthogonal Range Query"?

Orthogonal range query is the standard term for axis-aligned window/box filtering across dimensions. It is distinct from distance-based and kNN queries.

03

Match the index to its partitioning method:

kd-Trees split based on data distribution (often medians), while Quad-Trees split geometric space uniformly into equal quadrants regardless of local data density.

Section 10

State True or False based on the "Nowadays, Blocks are Flexible" slide: to To perform a point query using Bitmap indices, what is the first step?

01

State True or False based on the "Nowadays, Blocks are Flexible" slide:

1) False: object storage typically has higher latency than local disks. 2) True: network and service overhead dominate, so traditional block-latency assumptions change. 3) True: object systems expose flexible object granularity rather than strict fixed blocks. 4) False: partitioning still matters for scalability and pruning.

02

In data partitioning, what is the significance of the "Median element"?

The median is used to split data into two similarly sized partitions, which helps balance tree depth and query cost in data-partitioning structures like kd-Trees.

03

To perform a point query using Bitmap indices, what is the first step?

For a bitmap point predicate (attribute = value), the first step is to retrieve that value's bitmap and identify set bits. Those bits map to qualifying row IDs/blocks.

Knowledge check

Turn understanding into recall.

The quiz now follows the same concepts in scored form. You can return to this lesson from the quiz whenever a gap appears.