~/talk

Inside the ORM

Talkat DjangoCon US 2008 · on Saturday, 2008-09-06· [databases]
speakerdeck:malcolmt
slides:none on file

Claim: the ORM query layer was rewritten three times and the final code ships in Django 1.0. It actually builds a Pythonic query.py/query class that accumulates filters, joins and select columns and only emits SQL in as_sql, with database specifics pushed into DB backends. Real issues solved: expensive cloning of QuerySets, the setup_joins hotspot that manages aliases and outer vs inner joins, correct many‑to‑many excludes (via subselects), select_related fixes, and groundwork for aggregates, multiple DBs and deferred/only field loading.

AI-written summary · about

  1. 0:00Start
  2. 4:49django/db/models/query.py
  3. 6:16django/db/backends
  4. 8:16QuerySet method
  5. 8:54Model Managers
  6. 16:27Flow: QuerySet -- Query
  7. 17:57Flow: Query -- QuerySets
  8. 23:06Internal Examples
  9. 25:42DateQuerySet
  10. 30:21Query.add_filter
  11. 31:40Query.setup_joins
  12. 40:24Tricky Things
  13. 47:11Coming Soon(-ish)
  14. 49:18Extensions
  15. 52:50Existing Plumbing
  16. 53:56Missing Plumbing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.