Files
outline/server/models
Claude b399ffaca9 perf: Remove eager user joins from Document default scope
Every Document query previously eager-loaded the createdBy and updatedBy
User associations via the default scope, paying for two LEFT JOINs to the
wide users table on every query — including the many policy checks,
background tasks, and command paths that never read them.

The associations are now resolved only where needed:

- The document presenter loads users through a new request-scoped
  DataLoader (server/utils/loaders.ts), so a page of documents resolves
  all creator/updater rows in a single batched query, memoized per
  request. When no request context is available a shared batch-only
  (non-caching) loader is used instead.
- Consumers that only needed the actor ID now read the FK column
  directly (lastModifiedById) instead of the joined row.
- Single-document consumers (revisions.info, JSON export, Slack
  processor, unfurls) load the association explicitly or lazily.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012rKcnTfSLGCzcMq4yvmopj
2026-07-05 10:10:23 +00:00
..
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-05-06 21:10:51 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00
2026-06-29 17:11:02 -04:00