Indexes and Record Modification - Secondary Indexes




CS157b

Chris Pollett

Feb 12, 2020

Outline

Introduction

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

In-Class Exercise

Suppose we pre-allocate 10 blocks for a unsorted relation. Each block can typically hold five variable sized records. We are using PCTFREE=20, PCTUSED=40. Apply a sequence of operations to this relation/blocks where an insert has probability 5/6, and a delete has probability 1/6 (use dice). Keep going until either all blocks are at their limit or until a block gets re-added to the free block list. Show the state of the 10 blocks after each adding/deleting of records.

Post your solution to the Feb 12 In-Class Exercise Thread.

Secondary Indexes

Design of Secondary Indexes

Secondary Index Example

Applications of Secondary Indexes

Indirection in Secondary Indexes