SQL from the bit up
Learn what a database does with your query, from bytes on disk to window functions, then write SQL that stays fast.
Lessons
- 01Rows, pages and filesA table is bytes in a file, read one page at a time. Learn the layout before you learn the language.○ not started
- 02SELECT is a scanWithout an index, every SELECT is a loop over every row. See the loop, then learn the three ways engines make it shorter.○ not started
- 03GROUP BY is a hash mapGROUP BY is one pass over the rows and a dictionary of running totals. Build it in Python, then read the SQL as the same thing.○ not started
- 04Joins are loops and hash tablesA join is two loops, or one hash table and one loop. Know which, and you know why a join is fast, slow or silently wrong.○ not started
- 05Window functions without the magicA window function is a sort, a split into partitions, and a walk down each one. Learn the walk and running totals, ranks and dedup stop being tricks.○ not started
- 06Indexes are sorted copiesPlanned
- 07NULL is not a valuePlanned
- 08CTEs, subqueries and what the planner does with themPlanned
- 09Reading a query planPlanned
- 10Slowly changing dimensions with plain SQLPlanned