usergraphtheory's picture
Sync from erdostack/bench at a7805c45d77258d316383c92bdc9f472498d255f (part 11)
e2344df verified
|
Raw History Blame Contribute Delete
620 Bytes

I'd object to the CTE before Jonas writes it. Replies here are one level deep by spec and by a check constraint (comment_depth_at_most_one), so a thread page is 20 parents plus their children: there's no unknown depth for a recursive query, treebeard or a graph store to handle. The slowness is the view running a median of 63 statements per request (one per top-level comment for replies, one per comment for the author) at about 2 ms each. Fetching replies for all 20 parents in one query and joining authors gets that down to two or three. Decision: no-graph, in docs/graph/DECISION.md. I haven't touched the view.