Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 4432lecture #11 - indexing & hashing1 CS4432: Database Systems II Lecture #11 Professor Elke A. Rundensteiner.

Similar presentations


Presentation on theme: "CS 4432lecture #11 - indexing & hashing1 CS4432: Database Systems II Lecture #11 Professor Elke A. Rundensteiner."— Presentation transcript:

1 CS 4432lecture #11 - indexing & hashing1 CS4432: Database Systems II Lecture #11 Professor Elke A. Rundensteiner

2 CS 4432lecture #11 - indexing & hashing2 Index definition in SQL Create index name on rel (attr) Drop INDEX name

3 CS 4432lecture #11 - indexing & hashing3 CANNOT SPECIFY TYPE OF INDEX (e.g. B-tree, Hashing, …) OR PARAMETERS (e.g. Load Factor, Size of Hash,...)... at least in SQL... Note

4 CS 4432lecture #11 - indexing & hashing4 ATTRIBUTE LIST  MULTIKEY INDEX e.g., CREATE INDEX foo ON R(A,B,C) Note

5 CS 4432lecture #11 - indexing & hashing5 Motivation: Find records where DEPT = “Toy” AND SAL > 50k Multi-key Index

6 CS 4432lecture #11 - indexing & hashing6 Strategy I: Use one index, say Dept. Get all Dept = “Toy” records and check their salary I1I1

7 CS 4432lecture #11 - indexing & hashing7 Use 2 Indexes; Manipulate Pointers ToySal > 50k Strategy II:

8 CS 4432lecture #11 - indexing & hashing8 Multiple Key Index One idea: Strategy III: I1I1 I2I2 I3I3

9 CS 4432lecture #11 - indexing & hashing9 Example Record Dept Index Salary Index Name=Joe DEPT=Sales SAL=15k Art Sales Toy 10k 15k 17k 21k 12k 15k 19k

10 CS 4432lecture #11 - indexing & hashing10 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


Download ppt "CS 4432lecture #11 - indexing & hashing1 CS4432: Database Systems II Lecture #11 Professor Elke A. Rundensteiner."

Similar presentations


Ads by Google