Files
outline/server/models
Tom MoorandClaude Opus 5 2bf160ec39 perf: Avoid N+1 queries when deleting a document subtree (#13311)
Deleting a document walked its subtree with one query per document and
destroyed each in a serial post-order recursion, so large subtrees could
exceed the request statement_timeout.

Resolve the subtree with the existing recursive CTE helper and load the
children in a single query instead. Documents are still destroyed one at
a time so model hooks run for each, and deepest-first ordering is kept.

The subtree lookup also dropped the options it was passed, so it ran
outside the request transaction.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-05 20:44:29 -04:00
..
2026-07-23 09:10:17 -04:00
2026-07-23 09:10:17 -04:00
2026-07-23 09:10:17 -04:00
2026-07-23 09:10:17 -04:00
2026-07-23 09:10:17 -04:00
2026-07-23 09:10:17 -04:00
2026-07-23 09:10:17 -04:00
2026-07-23 09:10:17 -04:00
2026-05-06 21:10:51 -04:00
2026-07-23 09:10:17 -04:00