0% found this document useful (0 votes)
291 views9 pages

ISAM: Indexed-Sequential-Access-Method: Adapted From Prof Joe Hellerstein's Notes

ISAM is an older indexing method that uses a B-tree-like structure to index data stored in a sorted file. It stores index entries containing search keys and page pointers in index pages, which can then be searched to locate where corresponding data entries are stored in leaf pages. This allows more efficient searching than linearly scanning the entire sorted data file. Range searches using ISAM involve searching the index to find the first matching data entry, then scanning sequentially through subsequent pages. Data entries can overflow to additional overflow pages, and inserts/deletes only affect leaf pages.

Uploaded by

sindhusandeep712
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
291 views9 pages

ISAM: Indexed-Sequential-Access-Method: Adapted From Prof Joe Hellerstein's Notes

ISAM is an older indexing method that uses a B-tree-like structure to index data stored in a sorted file. It stores index entries containing search keys and page pointers in index pages, which can then be searched to locate where corresponding data entries are stored in leaf pages. This allows more efficient searching than linearly scanning the entire sorted data file. Range searches using ISAM involve searching the index to find the first matching data entry, then scanning sequentially through subsequent pages. Data entries can overflow to additional overflow pages, and inserts/deletes only affect leaf pages.

Uploaded by

sindhusandeep712
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 9

ISAM: Indexed-Sequential-AccessMethod

Adapted from Prof Joe Hellersteins notes http://db.cs.berkeley.edu/dbcourse/notes.html

A Note of Caution
ISAM is an old-fashioned idea B+-trees are usually better, as well see
Though not always

But, its a good place to start Simpler than B+-tree, but many of the same ideas Upshot Dont brag about being an ISAM expert on your resume Do understand how they work, and tradeoffs with B+-trees

Range Searches
`` Find all students with gpa > 3.0 If data is in sorted file, do binary search to find first such student, then scan to find others. Cost of binary search can be quite high. Simple idea: Create an `index file. Level of indirection again!
k1 k2 kN

Index File

Page 1

Page 2

Page 3

Page N

Data File

 Can do binary search on (smaller) index file!

index entry

ISAM

P 0

K 2

K m

Pm

Index file may still be quite large. But we can apply the idea repeatedly!

Non-leaf Pages

Leaf Pages Overflow page Primary pages

 Leaf pages contain data entries.

Example ISAM Tree


Each node can hold 2 entries; no need for `next-leaf-page pointers. (Why?)
Root
40

20

33

51

63

10*

15*

20*

27*

33*

37*

40*

46*

51*

55*

63*

97*

Data Pages

Comments on ISAM

Index Pages

File creation : Leaf (data) pages allocated Overflow pages sequentially, sorted by search key. Then index pages allocated. Then space for overflow pages. Index entries : <search key value, page id>; they `direct search for data entries , which are in leaf pages. Search : Start at root; use key comparisons to go to leaf. Cost log F N ; F = # entries/index pg, N = # leaf pgs Insert : Find leaf where data entry belongs, put it there. (Could be on an overflow page). Delete Find and remove from leaf; if empty overflow tatic tree: structure: inserts/deletes affect only leaf pages. page, de-allocate.

Example ISAM Tree


Each node can hold 2 entries; no need for `next-leaf-page pointers. (Why?)
Root
40

20

33

51

63

10*

15*

20*

27*

33*

37*

40*

46*

51*

55*

63*

97*

After Inserting 23*, 48*, 41*, 42* ...


Root Index Pages
20 33 51 63 40

Primary Leaf Pages


48* 41* 10* 15* 20* 27* 33* 37* 40* 46* 51* 55* 63* 97*

Overflow Pages

23*

42*

... then Deleting 42*, 51*, 97*


Root
40

20

33

51 63

10* 15*

20* 27*

33* 37*

40* 46*

55*

63*

23*

48* 41*

 Note that 51 appears in index levels, but 51* not in leaf!

You might also like