Docsity

Index Classification and Properties - Database Management - Lecture Slides, Slides of Introduction to Database Management Systems

Partial preview of the text

Download Index Classification and Properties - Database Management - Lecture Slides and more Slides Introduction to Database Management Systems in PDF only on Docsity!

Database

Management

System

Lecture - 37

Introduction

Any subset of the fields of a relation can be the search key for an index on the relation.

Search key is not the same as key (e.g. doesn’t have to be unique ID).

Introduction

Typically, index also contains

auxiliary information that directs searches to the desired data entries

Introduction

Can have multiple (different) indexes per file.  e.g. file sorted by stid , with a hash index on c gpa and a B+tree index on st name.

Index Classification

What selections does it support?

Representation of data entries in index  what kind of info is the index actually storing?

Index Classification

3 alternatives here

 Clustered vs. Un-clustered Indexes  Single Key vs. Composite Indexes  Tree-based, inverted files, pointers

Create Index Example

CREATE UNIQUE INDEX

pr_prName

ON program(prName)

Create Index Example

Can also be created on composite attributes

CREATE UNIQUE INDEX

St_Name ON

Student(stName ASC, stFName DESC)

Properties of Indexes

Support selections of form

field constant

Support equality selections

Either “tree” or “hash”

indexes help here.

Support Range selections

(operator is one among <, >,

<=, >=, BETWEEN)

“Hash” indexes don’t work

for these

Properties of Indexes

Secondary Key Index

Records are stored on the basis of key attribute; three possibilities  Sequential search  Sorted on the basis of name  Sort for command execution

Problematic

Secondary Key Index

Index on secondary key is

solution

Data remains in original order,

however secondary key index

maintains ordered sequence of

records, and provides direct access

Database

Management

System

Lecture - 37