council icon indicating copy to clipboard operation
council copied to clipboard

N + 1 with replies when viewing a thread.

Open Mo7sin opened this issue 7 years ago • 2 comments

Replies cause a big amount of (N + 1) issue.

69 statements were executed, 62 of which were duplicated, 7 unique

alt text


I think it's related to $reply->path() method.

Mo7sin avatar Feb 20 '18 15:02 Mo7sin

Hi @Mo7sin, I think these are 2 separate issues.

The N+1 issue is caused by

  • appending the path to Reply, without
  • eager loading the thread.

I'm working on a fix for that.

Also path() method needs to be modified to generate the correct URL for paginated replies

Maybe like that:

http://council.local/threads/eius/non-quasi-est-atque-maiores-et-ut-1?page=2#reply-21

As eager loading the Thread won't fix this, could you move that to a separate Issue?

Joucke avatar Mar 10 '18 22:03 Joucke

Hi @Joucke, I did create a new issue for Reply path() #221

Mo7sin avatar Mar 12 '18 13:03 Mo7sin