{
  "id": "django-prefetch-related-table",
  "kind": "table",
  "slug": "django-prefetch-related",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/django-prefetch-related/",
  "title": "Prefetch related objects in a Django QuerySet without a large join",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "prefetch_related",
      "source": "Django docs",
      "detail": "Separate lookup per relationship, joining in Python"
    },
    {
      "name": "select_related",
      "source": "Django docs",
      "detail": "Same database query, single-valued relationships"
    },
    {
      "name": "foreign key",
      "source": "Django docs",
      "detail": "One-to-one and foreign key can use select_related"
    },
    {
      "name": "query planner",
      "source": "Django docs",
      "detail": "Decides how to compute declarative SQL"
    }
  ],
  "related_slugs": [
    "django-querysets",
    "django-models",
    "sqlite-query-planner-indexes"
  ],
  "license": "CC-BY-4.0",
  "source_license": "BSD-3-Clause (Django docs); Public-Domain (SQLite); prose restates cited source lines in own words",
  "as_of": "2026-11-19",
  "status": "deep-draft-20261119",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}