Docsity

Inverted Files, Linked Lists - Database Management - Lecture Slides, Slides of Introduction to Database Management Systems

Partial preview of the text

Download Inverted Files, Linked Lists - Database Management - Lecture Slides and more Slides Introduction to Database Management Systems in PDF only on Docsity!

Database

Management

System

Lecture - 38

Inverted Files

The attribute on which we want

direct access, inverted file is created

on that field

File is said to be inverted on that

field

More than one inversions can be

created, even on all attributes

Inverted Files

Inverted file contains the values of

attribute in sorted order and the

relative address of the record

DBMS searches appropriate record

no and hands over to access method

to retrieve the desired record

Linked Lists

AKA Pointer Chain Needs an extra field in the physical record to store the link Relative addresses are used

Linked Lists

Head pointer needs to be stored Pointers for multiple fields can be created Circular pointers Double linked lists

Tree Index

Index is maintained in a hierarchical arrangements of nodes Each node stores key values and pointers; nodes are connected through links

B+ Trees

Number of pointers in a node is

one more than the number of keys

Number of pointers called order of

tree

Distance of all leaf nodes from the

root is same

Example Tree Index

 Index entries :<search key value,

page id> they direct search for

data entries in leaves.

Example where each node can

hold 2 entries.

Example Tree Index 10* 15* 20* 25* 33* 37* 40^ 46^ 51^ 55^ 63* 97*

Root 27*

Example Tree Index 10* 15* 20* 23* 33* 34* 40^ 46^ 51^ 55^ 63* 97*

Root 27*

Insert 22

10* 15* 20* 22* 33* 34* 40^ 46^ 51^ 55^ 63* 97*

Root 27*

Alternatives for Data

Entry k* in Index

What is actually stored in the leaves of the index for key value “k”?

Alternative 1 Actual data record (with key value k )

 If this is used, index structure is a

file organization for data records

(like Heap files or sorted files).

Alternative 1 At most one index on a given collection of data records can use Alternative 1.