1 CS232A: Database System Principles INDEXING. 2 Given condition on attribute find qualified records Attr = value Condition may also be Attr>value Attr>=value.

Slides:



Advertisements
Similar presentations
Index tuning-- B+tree. overview Variation on B+tree: B-tree (no +) Idea: –Avoid duplicate keys –Have record pointers in non-leaf nodes.
Advertisements

CS4432: Database Systems II Hash Indexing 1. Hash-Based Indexes Adaptation of main memory hash tables Support equality searches No range searches 2.
DBMS 2001Notes 4.2: Hashing1 Principles of Database Management Systems 4.2: Hashing Techniques Pekka Kilpeläinen (after Stanford CS245 slide originals.
Hashing and Indexing John Ortiz.
CS 245Notes 51 CS 245: Database System Principles Hector Garcia-Molina Notes 5: Hashing and More.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Indexing and Hashing Basic Concepts Ordered Indices B+-Tree Index Files B-Tree.
Index tuning Hash Index. overview Introduction Hash-based indexes are best for equality selections. –Can efficiently support index nested joins –Cannot.
Dr. Kalpakis CMSC 661, Principles of Database Systems Index Structures [13]
CPSC-608 Database Systems Fall 2010 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #7.
CS 4432lecture #11 - indexing & hashing1 CS4432: Database Systems II Lecture #11 Professor Elke A. Rundensteiner.
CS4432: Database Systems II
CS CS4432: Database Systems II Basic indexing.
B-trees - Hashing. 11.2Database System Concepts Review: B-trees and B+-trees Multilevel, disk-aware, balanced index methods primary or secondary dense.
1 Hash-Based Indexes Yanlei Diao UMass Amherst Feb 22, 2006 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
B+-tree and Hashing.
1 CS143: Index. 2 Topics to Learn Important concepts –Dense index vs. sparse index –Primary index vs. secondary index (= clustering index vs. non-clustering.
CS 277 – Spring 2002Notes 41 CS 277: Database System Implementation Notes 4: Indexing Arthur Keller.
CPSC-608 Database Systems Fall 2008 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #7.
©Silberschatz, Korth and Sudarshan12.1Database System Concepts Chapter 12: Part A Part A:  Index Definition in SQL  Ordered Indices  Index Sequential.
CPSC-608 Database Systems Fall 2010 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #8.
CPSC-608 Database Systems Fall 2011 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #11.
CPSC-608 Database Systems Fall 2009 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #9.
CPSC-608 Database Systems Fall 2008 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #8.
CS 245Notes 51 CS 245: Database System Principles Hector Garcia-Molina Notes 5: Hashing and More.
CS 4432lecture #10 - indexing & hashing1 CS4432: Database Systems II Lecture #10 Professor Elke A. Rundensteiner.
CS 277 – Spring 2002Notes 51 CS 277: Database System Implementation Arthur Keller Notes 5: Hashing and More.
CS 4432lecture #71 CS4432: Database Systems II Lecture #7 Professor Elke A. Rundensteiner.
1 Indexing Structures for Files. 2 Basic Concepts  Indexing mechanisms used to speed up access to desired data without having to scan entire.
CS 245Notes 41 CS 245: Database System Principles Notes 4: Indexing Hector Garcia-Molina.
CS CS4432: Database Systems II. CS Index definition in SQL Create index name on rel (attr) (Check online for index definitions in SQL) Drop.
CPSC-608 Database Systems Fall 2008 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #9.
1 CS143: Index. 2 Topics to Learn Important concepts –Dense index vs. sparse index –Primary index vs. secondary index (= clustering index vs. non-clustering.
CS 255: Database System Principles slides: B-trees
Index tuning-- B+tree. overview © Dennis Shasha, Philippe Bonnet 2001 B+-Tree Locking Tree Traversal –Update, Read –Insert, Delete phantom problem: need.
1 Chapter 12: Indexing and Hashing Indexing Indexing Basic Concepts Basic Concepts Ordered Indices Ordered Indices B+-Tree Index Files B+-Tree Index Files.
12.1 Chapter 12: Indexing and Hashing Spring 2009 Sections , , Problems , 12.7, 12.8, 12.13, 12.15,
Hashing and Hash-Based Index. Selection Queries Yes! Hashing  static hashing  dynamic hashing B+-tree is perfect, but.... to answer a selection query.
DBMS 2001Notes 4.1: B-Trees1 Principles of Database Management Systems 4.1: B-Trees Pekka Kilpeläinen (after Stanford CS245 slide originals by Hector Garcia-Molina,
CS 245Notes 51 CS 245: Database System Principles Hector Garcia-Molina Notes 5: Hashing and More.
CS 245Notes 51 CS 245: Database System Principles Hector Garcia-Molina Notes 5: Hashing and More.
Index Tuning Conventional index Secondary index To speed up queries on attributes not within primary key Primary index –Determine.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 Hash-Based Indexes Chapter 11 Modified by Donghui Zhang Jan 30, 2006.
Indexes. Primary Indexes Dense Indexes Pointer to every record of a sequential file, (ordered by search key). Can make sense because records may be much.
B+ tree & B tree Extracted from Garcia Molina
1 Chapter 12: Indexing and Hashing Indexing Indexing Basic Concepts Basic Concepts Ordered Indices Ordered Indices B+-Tree Index Files B+-Tree Index Files.
CMPT 454, Simon Fraser University, Fall 2009, Martin Ester 111 Database Systems II Index Structures.
1 CSCE 520 Test 2 Info Indexing Modified from slides of Hector Garcia-Molina and Jeff Ullman.
Hash-Based Indexes. Introduction uAs for any index, 3 alternatives for data entries k*: w Data record with key value k w w Choice orthogonal to the indexing.
CS4432: Database Systems II
1 Ullman et al. : Database System Principles Notes 5: Hashing and More.
1 Query Processing Part 3: B+Trees. 2 Dense and Sparse Indexes Advantage: - Simple - Index is sequential file good for scans Disadvantage: - Insertions.
CPSC 8620Notes 61 CPSC 8620: Database Management System Design Notes 6: Hashing and More.
1 Ullman et al. : Database System Principles Notes 4: Indexing.
Access Structures COMP3211 Advanced Databases Dr Nicholas Gibbins
COMP3017 Advanced Databases
CS 245: Database System Principles
CS 245: Database System Principles Notes 4: Indexing
CS 245: Database System Principles Notes 4: Indexing
CS232A: Database System Principles INDEXING
CPSC-608 Database Systems
CS 245: Database System Principles
Yan Huang - CSCI5330 Database Implementation – Access Methods
(Slides by Hector Garcia-Molina,
CS 245: Database System Principles
Index tuning Hash Index.
CS 245: Database System Principles Notes 4: Indexing
Database Design and Programming
Chapter 11: Indexing and Hashing
CS4432: Database Systems II
Index Structures Chapter 13 of GUW September 16, 2019
Presentation transcript:

1 CS232A: Database System Principles INDEXING

2 Given condition on attribute find qualified records Attr = value Condition may also be Attr>value Attr>=value Indexing  value Qualified records value

Indexing Data Stuctures used for quickly locating tuples that meet a specific type of condition –Equality condition: find Movie tuples where Director=X –Other conditions possible, eg, range conditions: find Employee tuples where Salary>40 AND Salary<50 Many types of indexes. Evaluate them on –Access time –Insertion time –Deletion time –Disk Space needed (esp. as it effects access time)

4 Topics Conventional indexes B-trees Hashing schemes

Terms and Distinctions Primary index –the index on the attribute (a.k.a. search key) that determines the sequencing of the table Secondary index –index on any other attribute Dense index –every value of the indexed attribute appears in the index Sparse index –many values do not appear A Dense Primary Index Sequential File

Dense and Sparse Primary Indexes Dense Primary Index Sparse Primary Index Find the index record with largest value that is less or equal to the value we are looking. + can tell if a value exists without accessing file (consider projection) + better access to overflow records + less index space more + and - in a while

7 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)

Multi-Level Indexes Treat the index as a file and build an index on it “Two levels are usually sufficient. More than three levels are rare.” Q: Can we build a dense second level index for a dense index ?

A Note on Pointers Record pointers consist of block pointer and position of record in the block Using the block pointer only saves space at no extra disk accesses cost

Representation of Duplicate Values in Primary Indexes Index may point to first instance of each value only

Deletion from Dense Index Delete 40, 80 Lists of available entries Deletion from dense primary index file with no duplicate values is handled in the same way with deletion from a sequential file Q: What about deletion from dense primary index with duplicates

Deletion from Sparse Index if the deleted entry does not appear in the index do nothing Delete 40

Deletion from Sparse Index (cont’d) if the deleted entry does not appear in the index do nothing if the deleted entry appears in the index replace it with the next search-key value –comment: we could leave the deleted value in the index assuming that no part of the system may assume it still exists without checking the block Delete 30

Deletion from Sparse Index (cont’d) if the deleted entry does not appear in the index do nothing if the deleted entry appears in the index replace it with the next search-key value unless the next search key value has its own index entry. In this case delete the entry Delete 40, then 30

Insertion in Sparse Index if no new block is created then do nothing Insert 35

16 Insertion in Sparse Index if no new block is created then do nothing else create overflow record –Reorganize periodically –Could we claim space of next block? –How often do we reorganize and how much expensive it is? –B-trees offer convincing answers Insert 15

17 Secondary indexes Sequence field File not sorted on secondary search key

18 Secondary indexes Sequence field Sparse index does not make sense!

19 Secondary indexes Sequence field Dense index sparse high level First level has to be dense, next levels are sparse (as usual)

20 Duplicate values & secondary indexes

21 Duplicate values & secondary indexes one option... Problem: excess overhead! disk space search time

22 Duplicate values & secondary indexes another option: lists of pointers Problem: variable size records in index!

23 Duplicate values & secondary indexes Yet another idea : Chain records with same key? Problems: Need to add fields to records, messes up maintenance Need to follow chain to know records

24 Duplicate values & secondary indexes buckets

25 Why “bucket” idea is useful IndexesRecords Name: primary EMP (name,dept,year,...) Dept: secondary Year: secondary Enables the processing of queries working with pointers only. Very common technique in Information Retrieval

Advantage of Buckets: Process Queries Using Pointers Only Find employees of the Toys dept with 4 years in the company SELECT Name FROM Employee WHERE Dept=“Toys” AND Year=4 Dept Index Year Index Intersect toy bucket and 2nd Floor bucket to get set of matching EMP’s

27 This idea used in text information retrieval Documents...the cat is fat......my cat and my dog like each other......Fido the dog... Buckets known as Inverted lists cat dog

28 Information Retrieval (IR) Queries Find articles with “cat” and “dog” –Intersect inverted lists Find articles with “cat” or “dog” –Union inverted lists Find articles with “cat” and not “dog” –Subtract list of dog pointers from list of cat pointers Find articles with “cat” in title Find articles with “cat” and “dog” within 5 words

29 Common technique: more info in inverted list cat Title5 100 Author10 Abstract57 Title12 d3d3 d2d2 d1d1 dog type position location

30 Posting: an entry in inverted list. Represents occurrence of term in article Size of a list:1Rare words or (in postings) mis-spellings 10 6 Common words Size of a posting: bits (compressed)

31 Vector space model w1 w2 w3 w4 w5 w6 w7 … DOC = Query= PRODUCT = 1 + ……. = score

32 Tricks to weigh scores + normalize e.g.: Match on common word not as useful as match on rare words...

Summary of Indexing So Far Basic topics in conventional indexes –multiple levels –sparse/dense –duplicate keys and buckets –deletion/insertion similar to sequential files Advantages –simple algorithms –index is sequential file Disadvantages –eventually sequentiality is lost because of overflows, reorganizations are needed

34 ExampleIndex (sequential) continuous free space overflow area (not sequential)

35 Outline: Conventional indexes B-Trees  NEXT Hashing schemes

36 NEXT: Another type of index –Give up on sequentiality of index –Try to get “balance”

37 Root B+Tree Examplen=

38 Sample non-leaf to keysto keysto keys to keys < 5757  k<8181  k<95 

39 Sample leaf node: From non-leaf node to next leaf in sequence To record with key 57 To record with key 81 To record with key 85

40 In textbook’s notationn=3 Leaf: Non-leaf:

41 Size of nodes:n+1 pointers n keys (fixed)

42 Non-root nodes have to be at least half-full Use at least Non-leaf:  (n+1)/2  pointers Leaf:  (n+1)/2  pointers to data

43 Full nodemin. node Non-leaf Leaf n=

44 B+tree rulestree of order n (1) All leaves at same lowest level (balanced tree) (2) Pointers in leaves point to records except for “sequence pointer”

45 (3) Number of pointers/keys for B+tree Non-leaf (non-root) n+1n  (n+1)/ 2   (n+1)/ 2  - 1 Leaf (non-root) n+1n Rootn+1n11 Max Max Min Min ptrs keys ptrs  data keys  (n+ 1) / 2 

46 Insert into B+tree (a) simple case –space available in leaf (b) leaf overflow (c) non-leaf overflow (d) new root

47 (a) Insert key = 32 n=

48 (a) Insert key = 7 n=

49 (c) Insert key = 160 n=

50 (d) New root, insert 45 n= new root

51 (a) Simple case - no example (b) Coalesce with neighbor (sibling) (c) Re-distribute keys (d) Cases (b) or (c) at non-leaf Deletion from B+tree

52 (b) Coalesce with sibling –Delete n=4 40

53 (c) Redistribute keys –Delete n=4 35

(d) Non-leaf coalese –Delete 37 n= new root

55 B+tree deletions in practice –Often, coalescing is not implemented –Too hard and not worth it!

56 Comparison: B-trees vs. static indexed sequential file Ref #1: Held & Stonebraker “B-Trees Re-examined” CACM, Feb. 1978

57 Ref # 1 claims: - Concurrency control harder in B-Trees - B-tree consumes more space For their comparison: block = 512 bytes key = pointer = 4 bytes 4 data records per block

58 Example: 1 block static index 127 keys (127+1)4 = 512 Bytes -> pointers in index implicit!up to 127 contigous blocks k1 k2 k3 k1k2k3 1 data block

59 Example: 1 block B-tree 63 keys 63x(4+4)+8 = 512 Bytes -> pointers needed in B-treeup to 63 blocks because index and datablocks are not contiguous k1 k2... k63 k1k2k3 1 data block next -

60 Size comparison Ref. #1 Static Index B-tree # data blocks height 2 -> > > 16, > ,130 -> 2,048, > 250, ,048 -> 15,752,961 5

61 Ref. #1 analysis claims For an 8,000 block file, after 32,000 inserts after 16,000 lookups  Static index saves enough accesses to allow for reorganization Ref. #1 conclusion Static index better!!

62 Ref #2: M. Stonebraker, “Retrospective on a database system,” TODS, June 1980 Ref. #2 conclusion B-trees better!!

63 DBA does not know when to reorganize –Self-administration is important target DBA does not know how full to load pages of new index Ref. #2 conclusion B-trees better!!

64 Buffering –B-tree: has fixed buffer requirements –Static index: large & variable size buffers needed due to overflow Ref. #2 conclusion B-trees better!!

65 Speaking of buffering… Is LRU a good policyfor B+tree buffers?  Of course not!  Should try to keep root in memory at all times (and perhaps some nodes from second level)

66 Interesting problem: For B+tree, how large should n be? … n is number of keys / node

Assumptions You have the right to set the disk page size for the disk where a B-tree will reside. Compute the optimum page size n assuming that –The items are 4 bytes long and the pointers are also 4 bytes long. –Time to read a node from disk is n –Time to process a block in memory is unimportant –B+tree is full (I.e., every page has the maximum number of items and pointers

68  Can get: f(n) = time to find a record f(n) n opt n

69  FIND n opt by f’(n) = 0 Answer should be n opt = “few hundred”  What happens to n opt as Disk gets faster? CPU get faster?

70 Variation on B+tree: B-tree (no +) Idea: –Avoid duplicate keys –Have record pointers in non-leaf nodes

71 to record to record to record with K1 with K2 with K3 to keys to keys to keys to keys k3 K1 P1K2 P2K3 P3

72 B-tree examplen= sequence pointers not useful now! (but keep space for simplicity)

73 So, for B-trees: MAXMIN Tree Rec Keys PtrsPtrs Ptrs Ptrs Non-leaf non-root n+1nn  (n+1)/2   (n+1)/2  -1  (n+1)/2  -1 Leaf non-root 1nn 1  (n+1)/2   (n+1)/2  Root non-leaf n+1nn Root Leaf 1nn 1 1 1

74 Tradeoffs: B-trees have marginally faster average lookup than B+trees (assuming the height does not change)  in B-tree, non-leaf & leaf different sizes  Smaller fan-out  in B-tree, deletion more complicated  B+trees preferred!

75 Example: - Pointers 4 bytes - Keys4 bytes - Blocks100 bytes (just example) - Look at full 2 level tree

76 Root has 8 keys + 8 record pointers + 9 son pointers = 8x4 + 8x4 + 9x4 = 100 bytes B-tree: Each of 9 sons: 12 rec. pointers (+12 keys) = 12x(4+4) + 4 = 100 bytes 2-level B-tree, Max # records = 12x9 + 8 = 116

77 Root has 12 keys + 13 son pointers = 12x4 + 13x4 = 100 bytes B+tree: Each of 13 sons: 12 rec. ptrs (+12 keys) = 12x(4 +4) + 4 = 100 bytes 2-level B+tree, Max # records = 13x12 = 156

78 So... ooooooooooooo ooooooooo 156 records 108 records Total = 116 B+ B 8 records Conclusion: –For fixed block size, –B+ tree is better because it is bushier

79 Outline/summary Conventional Indexes Sparse vs. dense Primary vs. secondary B trees B+trees vs. B-trees B+trees vs. indexed sequential Hashing schemes-->Next

Hashing hash function h(key) returns address of bucket or record for secondary index buckets are required if the keys for a specific hash value do not fit into one page the bucket is a linked list of pages key h(key) Records BucketsRecords key

81 Example hash function Key = ‘x 1 x 2 … x n ’ n byte character string Have b buckets h: add x 1 + x 2 + ….. x n – compute sum modulo b

82  This may not be best function …  Read Knuth Vol. 3 if you really need to select a good function. Good hash  Expected number of function:keys/bucket is the same for all buckets

83 Within a bucket: Do we keep keys sorted? Yes, if CPU time critical & Inserts/Deletes not too frequent

84 Next: example to illustrate inserts, overflows, deletes h(K)

85 EXAMPLE 2 records/bucket INSERT: h(a) = 1 h(b) = 2 h(c) = 1 h(d) = d a c b h(e) = 1 e

a b c e d EXAMPLE: deletion Delete: e f f g maybe move “g” up c d

87 Rule of thumb: Try to keep space utilization between 50% and 80% Utilization = # keys used total # keys that fit If < 50%, wasting space If > 80%, overflows significant depends on how good hash function is & on # keys/bucket

88 How do we cope with growth? Overflows and reorganizations Dynamic hashing Extensible Linear

89 Extensible hashing: two ideas (a) Use i of b bits output by hash function b h(K)  use i  grows over time…

90 (b) Use directory h(K)[0-i ] to bucket

91 Example: h(k) is 4 bits; 2 keys/bucket i = Insert New directory i = 2 2

Insert: i = Example continued

i = Insert: 1001 Example continued i = 3 3

94 Extensible hashing: deletion No merging of blocks Merge blocks and cut directory if possible (Reverse insert procedure)

95 Deletion example: Run thru insert example in reverse!

96 Extensible hashing Can handle growing files - with less wasted space - with no full reorganizations Summary + Indirection (Not bad if directory in memory) Directory doubles in size (Now it fits, now it does not) - -

97 Linear hashing Another dynamic hashing scheme Two ideas: (a) Use i low order bits of hash grows b i (b) File grows linearly

98 Example b=4 bits, i =2, 2 keys/bucket m = 01 (max used block) Future growth buckets If h(k)[i ]  m, then look at bucket h(k)[i ] else, look at bucket h(k)[i ] - 2 i -1 Rule 0101 can have overflow chains! insert 0101

99 Example b=4 bits, i =2, 2 keys/bucket m = 01 (max used block) Future growth buckets insert

100 Example Continued: How to grow beyond this? m = 11 (max used block) i =

101 If U > threshold then increase m (and maybe i )  When do we expand file? Keep track of: # used slots total # of slots = U

102 Linear Hashing Can handle growing files - with less wasted space - with no full reorganizations No indirection like extensible hashing Summary + + Can still have overflow chains -

103 Example: BAD CASE Very full Very emptyNeed to move m here… Would waste space...

104 Hashing - How it works - Dynamic hashing - Extensible - Linear Summary

105 Next: Indexing vs Hashing Index definition in SQL Multiple key access

106 Hashing good for probes given key e.g., SELECT … FROM R WHERE R.A = 5 Indexing vs Hashing

107 INDEXING (Including B Trees) good for Range Searches: e.g., SELECT FROM R WHERE R.A > 5 Indexing vs Hashing

108 Index definition in SQL Create index name on rel (attr) Create unique index name on rel (attr) defines candidate key Drop INDEX name

109 CANNOT SPECIFY TYPE OF INDEX (e.g. B-tree, Hashing, …) OR PARAMETERS (e.g. Load Factor, Size of Hash,...)... at least in SQL... Note

110 ATTRIBUTE LIST  MULTIKEY INDEX (next) e.g., CREATE INDEX foo ON R(A,B,C) Note

111 Motivation: Find records where DEPT = “Toy” AND SAL > 50k Multi-key Index

112 Strategy I: Use one index, say Dept. Get all Dept = “Toy” records and check their salary I1I1

113 Use 2 Indexes; Manipulate Pointers ToySal > 50k Strategy II:

114 Multiple Key Index One idea: Strategy III: I1I1 I2I2 I3I3

115 Example Record Dept Index Salary Index Name=Joe DEPT=Sales SAL=15k Art Sales Toy 10k 15k 17k 21k 12k 15k 19k

116 For which queries is this index good? Find RECs Dept = “Sales” SAL=20k Find RECs Dept = “Sales” SAL > 20k Find RECs Dept = “Sales” Find RECs SAL = 20k

117 Interesting application: Geographic Data DATA: x y...

118 Queries: What city is at ? What is within 5 miles from ? Which is closest point to ?

119 h n b i a c o d Example e g f m l k j h i a b c d e f g n o m l j k Search points near f Search points near b 5 15

120 Queries Find points with Yi > 20 Find points with Xi < 5 Find points “close” to i = Find points “close” to b =

121 Many types of geographic index structures have been suggested Quad Trees R Trees

122 Two more types of multi key indexes Grid Partitioned hash

123 Grid Index Key 2 X 1 X 2 …… X n V 1 V 2 Key 1 V n To records with key1=V 3, key2=X 2

124 CLAIM Can quickly find records with –key 1 = V i  Key 2 = X j –key 1 = V i –key 2 = X j And also ranges…. –E.g., key 1  V i  key 2 < X j

125  But there is a catch with Grid Indexes! How is Grid Index stored on disk? Like Array... X1X2X3X4 X1X2X3X4X1X2X3X4 V1V2V3 Problem: Need regularity so we can compute position of entry

126 Solution: Use Indirection Buckets V 1 V 2 V 3 * Grid only V 4 contains pointers to buckets Buckets -- X1 X2 X3

127 With indirection: Grid can be regular without wasting space We do have price of indirection

128 Can also index grid on value ranges SalaryGrid Linear Scale 123 ToySalesPersonnel 0-20K1 20K-50K2 50K-3 8

129 Grid files Good for multiple-key search Space, management overhead (nothing is free) Need partitioning ranges that evenly split keys + - -

130 Idea: Key1 Key2 Partitioned hash function h1h

131 h1(toy)=0000 h1(sales)=1001 h1(art)= h2(10k)=01100 h2(20k)=11101 h2(30k)=01110 h2(40k)=00111., EX: Insert

132 h1(toy)=0000 h1(sales)=1001 h1(art)= h2(10k)=01100 h2(20k)=11101 h2(30k)=01110 h2(40k)= Find Emp. with Dept. = Sales  Sal=40k

133 h1(toy)=0000 h1(sales)=1001 h1(art)= h2(10k)=01100 h2(20k)=11101 h2(30k)=01110 h2(40k)= Find Emp. with Sal=30k look here

134 h1(toy)=0000 h1(sales)=1001 h1(art)= h2(10k)=01100 h2(20k)=11101 h2(30k)=01110 h2(40k)= Find Emp. with Dept. = Sales look here

135 Post hashing discussion: - Indexing vs. Hashing - SQL Index Definition - Multiple Key Access - Multi Key Index Variations: Grid, Geo Data - Partitioned Hash Summary

136 Reading Chapter 5 Skim the following sections: –5.3.6, 5.3.7, –5.4.2, 5.4.3, Read the rest

137 The BIG picture…. Chapters 2 & 3: Storage, records, blocks... Chapter 4 & 5: Access Mechanisms - Indexes - B trees - Hashing - Multi key Chapter 6 & 7: Query Processing NEXT