Resolve users N+1 queries for child epics
When visiting an epic page that has child epics, the query childItems
executes N+1s for users, similar to:
SELECT "users".* FROM "users" WHERE "users"."id" = {USER_ID}
backtrace
[
"lib/peek/views/active_record.rb:55:in `block in setup_subscribers'",
"app/models/event.rb:199:in `note?'",
"app/models/event.rb:291:in `commit_note?'",
"app/models/event.rb:386:in `block (2 levels) in capability'",
"app/models/event.rb:386:in `any?'",
"app/models/event.rb:386:in `block in capability'",
"app/models/event.rb:385:in `each'",
"app/models/event.rb:385:in `flat_map'",
"app/models/event.rb:385:in `capability'",
"app/models/event.rb:155:in `visible_to_user?'",
"app/finders/events_finder.rb:118:in `block in paginated_filtered_by_user_visibility'",
"app/finders/events_finder.rb:118:in `paginated_filtered_by_user_visibility'",
"app/finders/events_finder.rb:47:in `execute'",
"app/finders/concerns/finder_with_cross_project_access.rb:37:in `block in execute'",
"app/finders/concerns/finder_with_cross_project_access.rb:40:in `execute'",
"ee/app/graphql/resolvers/epics/default_project_for_issue_creation_resolver.rb:34:in `last_issue_creation_event'",
"ee/app/graphql/resolvers/epics/default_project_for_issue_creation_resolver.rb:13:in `resolve'",
"lib/gitlab/graphql/present/field_extension.rb:18:in `resolve'",
"lib/gitlab/graphql/tracers/timer_tracer.rb:20:in `trace'",
"lib/gitlab/graphql/generic_tracing.rb:48:in `with_labkit_tracing'",
"lib/gitlab/graphql/generic_tracing.rb:38:in `platform_trace'",
"lib/gitlab/graphql/tracers/logger_tracer.rb:14:in `trace'",
"lib/gitlab/graphql/tracers/metrics_tracer.rb:13:in `trace'",
"lib/gitlab/graphql/tracers/application_context_tracer.rb:23:in `trace'",
"lib/gitlab/graphql/tracers/timer_tracer.rb:20:in `trace'",
"lib/gitlab/graphql/generic_tracing.rb:48:in `with_labkit_tracing'",
"lib/gitlab/graphql/generic_tracing.rb:38:in `platform_trace'",
"lib/gitlab/graphql/tracers/logger_tracer.rb:14:in `trace'",
"lib/gitlab/graphql/tracers/metrics_tracer.rb:13:in `trace'",
"lib/gitlab/graphql/tracers/application_context_tracer.rb:23:in `trace'",
"lib/gitlab/graphql/tracers/timer_tracer.rb:20:in `trace'",
"lib/gitlab/graphql/generic_tracing.rb:48:in `with_labkit_tracing'",
"lib/gitlab/graphql/generic_tracing.rb:38:in `platform_trace'",
"lib/gitlab/graphql/tracers/logger_tracer.rb:14:in `trace'",
"lib/gitlab/graphql/tracers/metrics_tracer.rb:13:in `trace'",
"lib/gitlab/graphql/tracers/application_context_tracer.rb:23:in `trace'",
"app/graphql/gitlab_schema.rb:51:in `multiplex'",
"app/controllers/graphql_controller.rb:160:in `execute_multiplex'",
"app/controllers/graphql_controller.rb:57:in `execute'",
"ee/lib/gitlab/ip_address_state.rb:10:in `with'",
"ee/app/controllers/ee/application_controller.rb:45:in `set_current_ip_address'",
"app/controllers/application_controller.rb:531:in `set_current_admin'",
"lib/gitlab/session.rb:11:in `with_session'",
"app/controllers/application_controller.rb:522:in `set_session_storage'",
"app/controllers/application_controller.rb:516:in `set_locale'",
"app/controllers/application_controller.rb:510:in `set_current_context'",
"ee/lib/omni_auth/strategies/group_saml.rb:41:in `other_phase'",
"lib/gitlab/jira/middleware.rb:19:in `call'",
"lib/gitlab/database/query_analyzer.rb:37:in `within'"
]