Where this lecture sits
- Course logistics: Project 1 (buffer pool) due that Sunday, a profiling/
perf+ flame-graph recording was published, Homework 3 releases on the 25th, midterm on October 9th covering material through lecture 100:521:27. - Project 2 is a B+Tree, built from the material of this lecture
7:15. - Recap of the previous lecture: hash tables give average O(1) lookup, but they are used mostly for internal DBMS bookkeeping during query and transaction execution, not as user-facing indexes
3:213:50.
Two data structures, two jobs
| Index | Filter | |
|---|---|---|
| Answers | "where is key K?" | "does key K exist?" (set membership) |
| Precision | exact location (tuple / small set of tuples) | probabilistic: "probably yes" or "definitely no" |
| Example | B-Tree / B+Tree | Bloom filter |
| Declared by | a human, explicitly (CREATE INDEX) | usually internal; some systems let you declare them |
- An index is a data structure built over some subset (or all) of a table's attributes, kept organized/sorted so lookups find a single tuple quickly
4:595:09.- Not always a single tuple: Postgres indexes can return blocks of tuples
5:09.
- Not always a single tuple: Postgres indexes can return blocks of tuples
- A filter answers set-membership queries — it tells you a key probably exists, but never where it is; the canonical example is the Bloom filter, covered in a later lecture
5:246:01. - Bloom filters can be declared on tables in some systems for query optimization, but they are usually an internal structure
6:01.
The maintenance obligation
- Anything in the table must be reflected in its indexes and filters, otherwise lookups produce false negatives
6:276:55. - Keeping indexes synchronized and thread-safe under concurrent access is the subject of the following lecture
6:27.