1 / 9

ISAM: Indexed-Sequential-Access-Method

ISAM: Indexed-Sequential-Access-Method. Adapted from Prof Joe Hellerstein’s 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 we’ll see Though not always But, it’s a good place to start

kimn
Download Presentation

ISAM: Indexed-Sequential-Access-Method

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ISAM: Indexed-Sequential-Access-Method Adapted from Prof Joe Hellerstein’s notes http://db.cs.berkeley.edu/dbcourse/notes.html

  2. A Note of Caution • ISAM is an old-fashioned idea • B+-trees are usually better, as we’ll see • Though not always • But, it’s a good place to start • Simpler than B+-tree, but many of the same ideas • Upshot • Don’t brag about being an ISAM expert on your resume • Do understand how they work, and tradeoffs with B+-trees

  3. Index File kN k2 k1 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! Data File Page N Page 3 Page 1 Page 2 • Can do binary search on (smaller) index file!

  4. Overflow page index entry ISAM P K P P K P K m 2 0 1 m 1 2 • Index file may still be quite large. But we can apply the idea repeatedly! Non-leaf Pages Leaf Pages Primary pages • Leaf pages contain data entries.

  5. Root 40 51 63 20 33 46* 55* 40* 51* 97* 10* 15* 20* 27* 33* 37* 63* Example ISAM Tree • Each node can hold 2 entries; no need for `next-leaf-page’ pointers. (Why?)

  6. Data Pages Index Pages Overflow pages Comments on ISAM • File creation: Leaf (data) pages allocated 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 page, de-allocate. • Static tree structure: inserts/deletes affect only leaf pages.

  7. Example ISAM Tree • Each node can hold 2 entries; no need for `next-leaf-page’ pointers. (Why?) Root 40 51 63 20 33 46* 55* 40* 51* 97* 10* 15* 20* 27* 33* 37* 63*

  8. After Inserting 23*, 48*, 41*, 42* ... Root 40 Index Pages 51 63 20 33 Primary Leaf 10* 15* 20* 27* 46* 55* 40* 51* 97* 33* 37* 63* Pages 41* 48* 23* Overflow Pages 42*

  9. ... then Deleting 42*, 51*, 97* Root 40 51 63 20 33 46* 55* 40* 10* 15* 20* 27* 33* 37* 63* 41* 48* 23* • Note that 51 appears in index levels, but 51* not in leaf!

More Related