docbrown/app
Jamie Gaskins 5d5dbaca95
Eager-load comment user data (#14902)
* Eager-load comment user data

Profiles and user settings are loaded for on each comment author. On
posts with many comments, this invokes a *lot* of DB queries. This
commit replaces 2 queries per comment with 2 queries for all comments.

* Fix where I misunderstood limit's purpose

This implementation is too clever. It looks like it should just be
getting all but the last, but it uses the fact that the default is 0 to
default to getting all of them. This isn't readily understandable to
someone reading the code.

I don't have a suggestion to fix it yet so I'm just going to leave it
as-is for now.
2021-10-05 10:05:01 +02:00
..
assets Article layout (#14753) 2021-09-30 19:08:06 +02:00
black_box Make Rubocop happy again (#14729) 2021-09-14 09:15:01 -05:00
components/admin/users Admin Member view: add Tools::HeaderComponent to reduce duplication (#14558) 2021-08-24 15:08:48 +02:00
controllers Automatically log a creator in after they confirm their email (#14855) 2021-10-04 19:09:51 +02:00
decorators Article layout (#14753) 2021-09-30 19:08:06 +02:00
errors Bump rubocop from 1.17.0 to 1.18.0 (#14107) 2021-07-01 13:51:49 +02:00
helpers Rubocop fixes (#14868) 2021-09-30 13:22:09 -04:00
javascript Heavy Confirmation Flow for DisplayAd-Destroy (#14862) 2021-10-04 08:36:43 -04:00
lib Forem passport (cont) (#14759) 2021-09-30 06:47:45 -06:00
liquid_tags Remove redundant freeze calls (#14596) 2021-08-26 10:01:08 -04:00
mailers Re-add dynamic delivery_method for ApplicationMailer (#13994) 2021-06-23 15:17:27 -04:00
models Eager-load comment user data (#14902) 2021-10-05 10:05:01 +02:00
policies Fix organization's admin unable to view an article's stats (#14767) 2021-09-21 16:05:34 +01:00
queries Adds validations to avoid creating unnecessary PNs (#14621) 2021-08-31 15:00:30 -06:00
refinements Drop profile columns from user (#10707) 2020-12-03 08:14:38 +07:00
sanitizers Remove redundant freeze calls (#14596) 2021-08-26 10:01:08 -04:00
serializers Remove duplicated work display from header / profile work (#14210) 2021-07-30 12:28:40 +02:00
services Add Forem Discover registration worker and service (#14865) 2021-10-01 10:27:31 -04:00
uploaders Bump rubocop from 1.18.4 to 1.19.0 (#14489) 2021-08-13 13:14:59 +07:00
validators Remove redundant freeze calls (#14596) 2021-08-26 10:01:08 -04:00
view_objects Upgrade to Ruby 3.0.2 (#12103) 2021-08-25 14:26:33 -04:00
views Eager-load comment user data (#14902) 2021-10-05 10:05:01 +02:00
workers Add Forem Discover registration worker and service (#14865) 2021-10-01 10:27:31 -04:00