@@ -249,7 +249,6 @@ textbook: "Ch. 8.3-8.4, 14.1-14.2, 14.4"
For every $c_i \equiv (A = a)$: Do you have any index on $A$?
For every $c_i \in \{\; (A \geq a), (A > a), (A \leq a), (A < a)\;\}$: Do you have a tree index on $A$?
For every $c_i, c_j$, do you have an appropriate index?
-
etc...
A simple table scan is also an option
Which one do we pick?
@@ -307,6 +306,50 @@ textbook: "Ch. 8.3-8.4, 14.1-14.2, 14.4"
+
+
+
+ What if we need multiple sort orders?
+
+
+
+ Data Organization
+
+
+
+
+ Data Organization
+
+
+
+
+ Data Organization
+
+
+
+
- Unordered Heap
+ - $O(N)$ reads.
+
+
+
+
- Sorted List
+ - $O(\log_2 N)$ random reads for some queries.
+
+
+
+
- Clustered (Primary) Index
+ - $O(\ll N)$ sequential reads for some queries.
+
+
+
+
- (Secondary) Index
+ - $O(\ll N)$ random reads for some queries.
+
+
+
+
+
+
@@ -322,7 +365,7 @@ textbook: "Ch. 8.3-8.4, 14.1-14.2, 14.4"
Different $k$s are unlikely to have the same hash value.
- Modulus $h(k)\mod N$ gives you a random number in $[0, N)$
+ $h(k)\mod N$ gives you a random number in $[0, N)$