{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Notes04 - CS245:DatabaseSystem Principles Notes4:Indexing...

Info icon This preview shows pages 1–25. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 245 Notes 4 1 CS 245: Database System  Principles Notes 4: Indexing Hector Garcia-Molina
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 2 Indexing  & Hashing value Chapter 4 ? value record
Image of page 2
CS 245 Notes 4 3 Topics Conventional indexes B-trees Hashing schemes
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 4 Sequential File 20 10 40 30 60 50 80 70 100 90
Image of page 4
CS 245 Notes 4 5 Sequential File 20 10 40 30 60 50 80 70 100 90 Dense Index 10 20 30 40 50 60 70 80 90 100 110 120
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 6 Sequential File 20 10 40 30 60 50 80 70 100 90 Sparse Index 10 30 50 70 90 110 130 150 170 190 210 230
Image of page 6
CS 245 Notes 4 7 Sequential File 20 10 40 30 60 50 80 70 100 90 Sparse 2nd level 10 30 50 70 90 110 130 150 170 190 210 230 10 90 170 250 330 410 490 570
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 8 Comment: {FILE,INDEX} may be contiguous    or not (blocks chained)
Image of page 8
CS 245 Notes 4 9 Question: Can we build a dense, 2nd level index  for a dense index?
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 10 Notes on pointers: (1) Block pointer (sparse index) can be  smaller than record pointer BP RP
Image of page 10
CS 245 Notes 4 11 (2) If file is contiguous, then we can omit pointers (i.e., compute them) Notes on pointers:
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 12 K1 K3 K4 K2 R1 R2 R3 R4
Image of page 12
CS 245 Notes 4 13 K1 K3 K4 K2 R1 R2 R3 R4 say: 1024 B per block  if we want K3 block:     get it at offset     (3-1)1024     = 2048 bytes
Image of page 13

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 14 Sparse vs. Dense Tradeoff Sparse:  Less index space per record         can keep more of index in memory Dense:   Can tell if any record exists        without accessing file (Later:  sparse better for insertions dense needed for secondary indexes)
Image of page 14
CS 245 Notes 4 15 Terms Index sequential file Search key (    primary key) Primary index (on Sequencing field) Secondary index Dense index (all Search Key values in) Sparse index Multi-level index
Image of page 15

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 16 Next: Duplicate keys Deletion/Insertion Secondary indexes
Image of page 16
CS 245 Notes 4 17 Duplicate keys 10 10 20 10 30 20 30 30 45 40
Image of page 17

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 18 10 10 20 10 30 20 30 30 45 40 10 10 10 20 20 30 30 30 Dense index, one way to implement? Duplicate keys
Image of page 18
CS 245 Notes 4 19 10 10 20 10 30 20 30 30 45 40 10 20 30 40 Dense index, better way? Duplicate keys
Image of page 19

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CS 245 Notes 4 20 10 10 20 10 30 20 30 30 45 40 10 10 20 30 Sparse index, one way? Duplicate keys
Image of page 20
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern