~/talk

Many-to-many, minus the middleman

Talkat PyCon Australia 2015 · 2015-07-31..08-04· [databases, django]
name:Alex Hill
links:none on file
slides:none on file

An alternative Django ManyToManyField replaces the intermediary table with a Postgres inverted index using Postgres tsquery/tsvector full-text search, claiming queries run at least 2x faster on a ~10 million row dataset and that the supporting index is roughly 100x smaller than a join table. It implements a custom relation via ORM join hooks, is read-only for now, and a Django join-fix patch is accepted for 1.9; code and benchmarks accompany the claim.

AI-written summary · about

  1. 0:00Start
  2. 1:48Navigation hierarchy
  3. 2:22In Django
  4. 2:41Selecting books at a node
  5. 3:04Oops: we need subtrees
  6. 4:15Subject expressions
  7. 5:42How does full-text search work?
  8. 7:06Custom types and lookups
  9. 9:06Many-to-many mayhem Model
  10. 11:09Success!
  11. 12:20Benefits
  12. 14:40Materialised path
~/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.