Indexes and Record Modification - Secondary Indexes




CS157b

Chris Pollett

Feb 13, 2023

Outline

Introduction

Dense Index Example

Sparse Indexes

Illustration of block structure of a sparse index

Sparse Index Example

Multi-Level Indexes

Indexes with Duplicate Search Keys

Indexes and Data Modification

Action on fileDense IndexSparse Index
Create Blocksnoneinsert if sequential
Delete Blocksnonedelete if sequential
Insertinsert also into indexupdate(?)
Deletedelete also from indexupdate(?)
Slideupdateupdate(?)

Avoiding Overflow Blocks, Preventing Row Migration

Quiz

Which of the following statements is true?

  1. Since each record has its own header, DB blocks typically don't have headers.
  2. If a variable length record is updated to a shorter record, we can overwrite the old record and add unused space to an available space list.
  3. Any record that cannot fit into a block is called a blob.

Secondary Indexes

Design of Secondary Indexes

Secondary Index Example

Applications of Secondary Indexes

Indirection in Secondary Indexes

Document Retrieval and Inverted Indexes