License cache could be more optimized
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=331193) </details> <!--IssueSummary end--> When looking at one of the demo projects in a local instance, I've noticed that we were calling multiple times the `License.current` which were cached, but taking a significant time to load. What standout was that while taking half a millisecond, because that was being called many times it was taking a couple of ms in total (while probably also generating pressure on garbage collection). ![image](/uploads/267f5a644445507b488446ba3facf77d/image.png) Here is a raw dump of the queries from peek with one License case expanded (in the example below that was called 28 times, taking likely ~ 15ms in total: ```sql 10.715ms SELECT "ci_builds".* FROM "ci_builds" WHERE "ci_builds"."type" = 'Ci::Build' AND "ci_builds"."commit_id" = 5 AND ("ci_builds"."retried" = FALSE OR "ci_builds"."retried" IS NULL) AND (EXISTS (SELECT 1 FROM "ci_job_artifacts" WHERE (ci_builds.id = ci_job_artifacts.job_id) AND "ci_job_artifacts"."file_type" IN (19, 26, 1, 17, 9, 7, 8, 6, 16, 4, 10, 101, 15, 12, 11, 24, 25, 5, 21, 22))) AND (artifacts_expire_at IS NULL OR artifacts_expire_at > '2021-05-18 00:48:13.173701') /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/ci/pipeline.rb:989:in `latest_builds_with_artifacts'*/ 9.852ms SELECT a.attname FROM ( SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx FROM pg_index WHERE indrelid = '"clusters"'::regclass AND indisprimary ) i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[i.idx] ORDER BY i.idx 8.544ms SELECT a.attname FROM ( SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx FROM pg_index WHERE indrelid = '"project_mirror_data"'::regclass AND indisprimary ) i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[i.idx] ORDER BY i.idx 8.501ms SELECT a.attname FROM ( SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx FROM pg_index WHERE indrelid = '"project_statistics"'::regclass AND indisprimary ) i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[i.idx] ORDER BY i.idx 7.582ms SELECT a.attname FROM ( SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx FROM pg_index WHERE indrelid = '"ci_builds"'::regclass AND indisprimary ) i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[i.idx] ORDER BY i.idx 6.916ms SELECT 1 AS one FROM "clusters" INNER JOIN "cluster_projects" ON "clusters"."id" = "cluster_projects"."cluster_id" WHERE "cluster_projects"."project_id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/presenters/project_presenter.rb:375:in `kubernetes_cluster_anchor_data'*/ 5.115ms SELECT "taggings".* FROM "taggings" WHERE "taggings"."taggable_id" = 6 AND "taggings"."taggable_type" = 'Project' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/views/projects/_home_panel.html.haml:28:in `_app_views_projects__home_panel_html_haml___1008614109217798783_271640'*/ 4.796ms SELECT 1 AS one FROM "projects" WHERE "projects"."namespace_id" IN (WITH RECURSIVE "base_and_descendants" AS ((SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 26) UNION (SELECT "namespaces".* FROM "namespaces", "base_and_descendants" WHERE "namespaces"."type" = 'Group' AND "namespaces"."parent_id" = "base_and_descendants"."id")) SELECT id FROM "base_and_descendants" AS "namespaces") AND "projects"."shared_runners_enabled" = TRUE LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/ee/app/models/ee/namespace.rb:250:in `any_project_with_shared_runners_enabled?'*/ 4.608ms SELECT COUNT(*) FROM "releases" WHERE "releases"."project_id" = 6 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/presenters/project_presenter.rb:203:in `releases_anchor_data'*/ 4.606ms SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."project_id" = 6 AND ("ci_pipelines"."source" IN (1, 2, 3, 4, 5, 6, 7, 8, 10, 11) OR "ci_pipelines"."source" IS NULL) AND "ci_pipelines"."ref" = 'master' AND "ci_pipelines"."id" IN (SELECT "ci_pipelines"."id" FROM "ci_pipelines" WHERE "ci_pipelines"."project_id" = 6 AND ("ci_pipelines"."source" IN (1, 2, 3, 4, 5, 6, 7, 8, 10, 11) OR "ci_pipelines"."source" IS NULL) AND "ci_pipelines"."ref" = 'master' ORDER BY "ci_pipelines"."id" DESC LIMIT 100) AND ("ci_pipelines"."status" IN ('success')) ORDER BY "ci_pipelines"."id" DESC LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/ci/pipeline.rb:371:in `latest_successful_for_ref'*/ 4.509ms SELECT "users".* FROM "users" INNER JOIN "members" ON "users"."id" = "members"."user_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."source_id" = 26 AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."access_level" != 5 AND "members"."access_level" = 50 ORDER BY "users"."id" ASC LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/group.rb:697:in `default_owner'*/ 4.453ms SELECT COUNT(*) FROM "issues" WHERE ("issues"."state_id" IN (1)) AND "issues"."issue_type" IN (0, 1) AND "issues"."project_id" = 6 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/services/base_count_service.rb:26:in `uncached_count'*/ 4.323ms SELECT "badges".* FROM ((SELECT "badges".* FROM "badges" WHERE "badges"."type" = 'ProjectBadge' AND "badges"."project_id" = 6) UNION (SELECT "badges".* FROM "badges" WHERE "badges"."type" = 'GroupBadge' AND "badges"."group_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 26))) badges ORDER BY "badges"."created_at" ASC /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/views/projects/_home_panel.html.haml:86:in `_app_views_projects__home_panel_html_haml___1008614109217798783_271640'*/ 4.217ms SELECT "protected_branch_push_access_levels".* FROM "protected_branch_push_access_levels" WHERE "protected_branch_push_access_levels"."protected_branch_id" = 4 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/concerns/protected_ref.rb:56:in `each'*/ 3.757ms WITH RECURSIVE "base_and_descendants" AS ((SELECT "namespaces".* FROM "namespaces" INNER JOIN "members" ON "namespaces"."id" = "members"."source_id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "namespaces"."type" = 'Group' AND "members"."user_id" = 1 AND "members"."requested_at" IS NULL AND (access_level >= 10) AND "members"."access_level" IN (40, 50)) UNION (SELECT "namespaces".* FROM "namespaces", "base_and_descendants" WHERE "namespaces"."type" = 'Group' AND "namespaces"."parent_id" = "base_and_descendants"."id")) SELECT "namespaces".* FROM "base_and_descendants" AS "namespaces" /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/user.rb:1533:in `+'*/ 3.623ms SELECT "members".* FROM "members" WHERE "members"."type" = 'ProjectMember' AND "members"."source_id" = 6 AND "members"."source_type" = 'Project' AND "members"."requested_at" IS NULL AND "members"."user_id" = 1 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/views/shared/members/_access_request_links.html.haml:3:in `_app_views_shared_members__access_request_links_html_haml__3567752995446348963_271920'*/ 3.32ms SELECT "project_settings".* FROM "project_settings" WHERE "project_settings"."project_id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/project.rb:840:in `project_setting'*/ 3.13ms SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = 6 AND "taggings"."taggable_type" = 'Project' AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL) ORDER BY taggings.id /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/views/projects/_home_panel.html.haml:28:in `_app_views_projects__home_panel_html_haml___1008614109217798783_271640'*/ 3.116ms SELECT "protected_branches".* FROM "protected_branches" WHERE "protected_branches"."project_id" = 6 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/concerns/protected_ref.rb:66:in `matching'*/ 3.056ms SELECT "notification_settings".* FROM "notification_settings" WHERE "notification_settings"."user_id" = 1 AND "notification_settings"."source_type" = 'Project' AND "notification_settings"."source_id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/user.rb:1623:in `notification_settings_for'*/ 2.56ms SELECT "repository_languages".* FROM "repository_languages" WHERE "repository_languages"."project_id" = 6 ORDER BY share DESC /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/views/projects/show.html.haml:15:in `_app_views_projects_show_html_haml___2129024408719342493_271260'*/ 2.551ms SELECT "fork_networks".* FROM "fork_networks" INNER JOIN "fork_network_members" ON "fork_networks"."id" = "fork_network_members"."fork_network_id" WHERE "fork_network_members"."project_id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/namespace.rb:232:in `find_fork_of'*/ 2.257ms SELECT COUNT(*) FROM "keys" WHERE "keys"."user_id" = 1 AND ("keys"."type" IN ('LDAPKey', 'Key') OR "keys"."type" IS NULL) /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/services/base_count_service.rb:26:in `uncached_count'*/ 2.214ms SELECT "appearances".* FROM "appearances" ORDER BY "appearances"."id" ASC LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/appearance.rb:39:in `current_without_cache'*/ 2.212ms SELECT 1 AS one FROM "services" WHERE "services"."template" = TRUE AND "services"."type" IN ('AsanaService', 'AssemblaService', 'BambooService', 'BugzillaService', 'BuildkiteService', 'CampfireService', 'ConfluenceService', 'CustomIssueTrackerService', 'DiscordService', 'DroneCiService', 'EmailsOnPushService', 'EwmService', 'ExternalWikiService', 'FlowdockService', 'HangoutsChatService', 'IrkerService', 'JiraService', 'MattermostService', 'MattermostSlashCommandsService', 'MicrosoftTeamsService', 'MockCiService', 'MockMonitoringService', 'PackagistService', 'PipelinesEmailService', 'PivotaltrackerService', 'PrometheusService', 'PushoverService', 'RedmineService', 'SlackService', 'SlackSlashCommandsService', 'TeamcityService', 'UnifyCircuitService', 'WebexTeamsService', 'YoutrackService') AND "services"."active" = TRUE LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/helpers/user_callouts_helper.rb:47:in `show_service_templates_deprecated_callout?'*/ 2.185ms SELECT "project_auto_devops".* FROM "project_auto_devops" WHERE "project_auto_devops"."project_id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/project.rb:932:in `first_auto_devops_config'*/ 2.089ms SELECT "projects".* FROM "projects" INNER JOIN "fork_network_members" ON "projects"."id" = "fork_network_members"."project_id" WHERE "fork_network_members"."fork_network_id" = 4 AND "projects"."id" IN (SELECT "projects"."id" FROM "projects" WHERE "projects"."namespace_id" = 1) ORDER BY "projects"."id" ASC LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/namespace.rb:237:in `block (2 levels) in find_fork_of'*/ 2.001ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"ci_job_artifacts"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.894ms SELECT "project_statistics".* FROM "project_statistics" WHERE "project_statistics"."project_id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/presenters/project_presenter.rb:219:in `commits_anchor_data'*/ 1.755ms SELECT "project_mirror_data".* FROM "project_mirror_data" WHERE "project_mirror_data"."project_id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/project.rb:406:in `import_in_progress?'*/ 1.693ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'invite_members_new_dropdown_experiment_percentage' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.687ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'namespace_storage_limit' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.667ms SELECT "ci_pipelines".* FROM "ci_pipelines" WHERE "ci_pipelines"."project_id" = 6 AND ("ci_pipelines"."source" IN (1, 2, 3, 4, 5, 6, 7, 8, 10, 11) OR "ci_pipelines"."source" IS NULL) AND "ci_pipelines"."ref" = 'master' AND "ci_pipelines"."sha" = 'f15b32277d2c55c6c595845a87109b09c913c556' AND "ci_pipelines"."id" IN (SELECT "ci_pipelines"."id" FROM "ci_pipelines" WHERE "ci_pipelines"."project_id" = 6 AND ("ci_pipelines"."source" IN (1, 2, 3, 4, 5, 6, 7, 8, 10, 11) OR "ci_pipelines"."source" IS NULL) AND "ci_pipelines"."ref" = 'master' AND "ci_pipelines"."sha" = 'f15b32277d2c55c6c595845a87109b09c913c556' ORDER BY "ci_pipelines"."id" DESC LIMIT 100) ORDER BY "ci_pipelines"."id" DESC LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/project.rb:1020:in `latest_pipeline'*/ 1.666ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'use_traversal_ids' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.66ms SELECT "user_statuses".* FROM "user_statuses" WHERE "user_statuses"."user_id" = 1 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/helpers/page_layout_helper.rb:168:in `user_status_properties'*/ 1.567ms SELECT 1 AS one FROM "projects" INNER JOIN "users_star_projects" ON "projects"."id" = "users_star_projects"."project_id" WHERE "users_star_projects"."user_id" = 1 AND "projects"."id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/user.rb:1493:in `starred?'*/ 1.549ms SELECT "user_preferences".* FROM "user_preferences" WHERE "user_preferences"."user_id" = 1 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/user.rb:1861:in `user_preference'*/ 1.484ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/ee/app/models/license.rb:302:in `load_license'*/ 1.449ms SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/policies/project_policy.rb:721:in `access_allowed_to?'*/ 1.436ms SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."owner_id" = 1 AND "namespaces"."type" IS NULL LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/user.rb:1203:in `fork_of'*/ 1.402ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'use_distinct_in_object_hierarchy' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.378ms SELECT "project_compliance_framework_settings".* FROM "project_compliance_framework_settings" WHERE "project_compliance_framework_settings"."project_id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/ee/app/helpers/ee/projects_helper.rb:234:in `show_compliance_framework_badge?'*/ 1.372ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"issues"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.37ms SELECT "user_callouts".* FROM "user_callouts" WHERE "user_callouts"."user_id" = 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/user.rb:1967:in `callouts_by_feature_name'*/ 1.338ms SELECT "user_details".* FROM "user_details" WHERE "user_details"."user_id" = 1 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/user.rb:1865:in `user_detail'*/ 1.331ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'learn_gitlab_b_experiment_percentage' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.312ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'use_distinct_for_all_object_hierarchy' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.312ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'cache_home_panel' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.306ms SELECT MAX("project_authorizations"."access_level") AS maximum_access_level, "project_authorizations"."user_id" AS project_authorizations_user_id FROM "project_authorizations" WHERE "project_authorizations"."project_id" = 6 AND "project_authorizations"."user_id" = 1 GROUP BY "project_authorizations"."user_id" /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/project_team.rb:173:in `block in max_member_access_for_user_ids'*/ 1.278ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'artifacts_management_page' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.277ms SELECT "projects".* FROM "projects" WHERE "projects"."id" = 6 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/project.rb:1503:in `forked?'*/ 1.269ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'learn_gitlab_a_experiment_percentage' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.252ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'refactor_blob_viewer' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.249ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'security_orchestration_policies_configuration' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.244ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'infrastructure_registry_page' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.242ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'cve_id_request_button' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.231ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'repo_integrations_link' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/experiments/application_experiment.rb:9:in `enabled?'*/ 1.214ms SELECT "members".* FROM "members" WHERE "members"."type" = 'ProjectMember' AND "members"."source_id" = 6 AND "members"."source_type" = 'Project' AND "members"."requested_at" IS NOT NULL AND "members"."user_id" = 1 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/views/shared/members/_access_request_links.html.haml:9:in `_app_views_shared_members__access_request_links_html_haml__3567752995446348963_271920'*/ 1.211ms SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 26 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/concerns/routable.rb:118:in `full_path'*/ 1.203ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'product_analytics' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.18ms SELECT "feature_gates".* FROM "feature_gates" WHERE "feature_gates"."feature_key" = 'auto_devops_banner_disabled' /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/lib/feature.rb:80:in `enabled?'*/ 1.17ms SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 26 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/project.rb:2525:in `root_namespace'*/ 1.169ms SELECT 1 AS one FROM "identities" WHERE "identities"."user_id" = 1 AND (provider LIKE 'ldap%' AND extern_uid IS NOT NULL) LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/user.rb:1222:in `ldap_user?'*/ 1.168ms SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 26 AND "namespaces"."type" = 'Group' LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/ee/app/policies/ee/project_policy.rb:311:in `block (2 levels) in <module:ProjectPolicy>'*/ 1.155ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"taggings"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.147ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"notification_settings"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.102ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"keys"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.083ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"project_statistics"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.076ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 1.063ms SELECT "saml_providers".* FROM "saml_providers" WHERE "saml_providers"."group_id" = 26 LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/ee/lib/gitlab/auth/group_saml/sso_enforcer.rb:35:in `group_access_restricted?'*/ 1.059ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"project_settings"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.047ms SELECT "projects"."id" AS t0_r0, "projects"."name" AS t0_r1, "projects"."path" AS t0_r2, "projects"."description" AS t0_r3, "projects"."created_at" AS t0_r4, "projects"."updated_at" AS t0_r5, "projects"."creator_id" AS t0_r6, "projects"."namespace_id" AS t0_r7, "projects"."last_activity_at" AS t0_r8, "projects"."import_url" AS t0_r9, "projects"."visibility_level" AS t0_r10, "projects"."archived" AS t0_r11, "projects"."avatar" AS t0_r12, "projects"."merge_requests_template" AS t0_r13, "projects"."star_count" AS t0_r14, "projects"."merge_requests_rebase_enabled" AS t0_r15, "projects"."import_type" AS t0_r16, "projects"."import_source" AS t0_r17, "projects"."approvals_before_merge" AS t0_r18, "projects"."reset_approvals_on_push" AS t0_r19, "projects"."merge_requests_ff_only_enabled" AS t0_r20, "projects"."issues_template" AS t0_r21, "projects"."mirror" AS t0_r22, "projects"."mirror_last_update_at" AS t0_r23, "projects"."mirror_last_successful_update_at" AS t0_r24, "projects"."mirror_user_id" AS t0_r25, "projects"."shared_runners_enabled" AS t0_r26, "projects"."runners_token" AS t0_r27, "projects"."build_coverage_regex" AS t0_r28, "projects"."build_allow_git_fetch" AS t0_r29, "projects"."build_timeout" AS t0_r30, "projects"."mirror_trigger_builds" AS t0_r31, "projects"."pending_delete" AS t0_r32, "projects"."public_builds" AS t0_r33, "projects"."last_repository_check_failed" AS t0_r34, "projects"."last_repository_check_at" AS t0_r35, "projects"."container_registry_enabled" AS t0_r36, "projects"."only_allow_merge_if_pipeline_succeeds" AS t0_r37, "projects"."has_external_issue_tracker" AS t0_r38, "projects"."repository_storage" AS t0_r39, "projects"."repository_read_only" AS t0_r40, "projects"."request_access_enabled" AS t0_r41, "projects"."has_external_wiki" AS t0_r42, "projects"."ci_config_path" AS t0_r43, "projects"."lfs_enabled" AS t0_r44, "projects"."description_html" AS t0_r45, "projects"."only_allow_merge_if_all_discussions_are_resolved" AS t0_r46, "projects"."repository_size_limit" AS t0_r47, "projects"."printing_merge_request_link_enabled" AS t0_r48, "projects"."auto_cancel_pending_pipelines" AS t0_r49, "projects"."service_desk_enabled" AS t0_r50, "projects"."cached_markdown_version" AS t0_r51, "projects"."delete_error" AS t0_r52, "projects"."last_repository_updated_at" AS t0_r53, "projects"."disable_overriding_approvers_per_merge_request" AS t0_r54, "projects"."storage_version" AS t0_r55, "projects"."resolve_outdated_diff_discussions" AS t0_r56, "projects"."remote_mirror_available_overridden" AS t0_r57, "projects"."only_mirror_protected_branches" AS t0_r58, "projects"."pull_mirror_available_overridden" AS t0_r59, "projects"."jobs_cache_index" AS t0_r60, "projects"."external_authorization_classification_label" AS t0_r61, "projects"."mirror_overwrites_diverged_branches" AS t0_r62, "projects"."pages_https_only" AS t0_r63, "projects"."external_webhook_token" AS t0_r64, "projects"."packages_enabled" AS t0_r65, "projects"."merge_requests_author_approval" AS t0_r66, "projects"."pool_repository_id" AS t0_r67, "projects"."runners_token_encrypted" AS t0_r68, "projects"."bfg_object_map" AS t0_r69, "projects"."detected_repository_languages" AS t0_r70, "projects"."merge_requests_disable_committers_approval" AS t0_r71, "projects"."require_password_to_approve" AS t0_r72, "projects"."emails_disabled" AS t0_r73, "projects"."max_pages_size" AS t0_r74, "projects"."max_artifacts_size" AS t0_r75, "projects"."pull_mirror_branch_prefix" AS t0_r76, "projects"."remove_source_branch_after_merge" AS t0_r77, "projects"."marked_for_deletion_at" AS t0_r78, "projects"."marked_for_deletion_by_user_id" AS t0_r79, "projects"."suggestion_commit_message" AS t0_r80, "projects"."autoclose_referenced_issues" AS t0_r81, "routes"."id" AS t1_r0, "routes"."source_id" AS t1_r1, "routes"."source_type" AS t1_r2, "routes"."path" AS t1_r3, "routes"."created_at" AS t1_r4, "routes"."updated_at" AS t1_r5, "routes"."name" AS t1_r6 FROM "projects" LEFT OUTER JOIN "routes" ON "routes"."source_type" = 'Project' AND "routes"."source_id" = "projects"."id" WHERE "routes"."path" = 'flightjs/flight' LIMIT 1 Cached 1.026ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"cluster_projects"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.025ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"project_auto_devops"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.008ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"protected_branches"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 1.004ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"members"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 0.992ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"tags"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 0.982ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"releases"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 0.972ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"protected_branch_push_access_levels"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 0.939ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"badges"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 0.928ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.913ms SELECT 1 AS one FROM "identities" WHERE "identities"."user_id" = 1 AND "identities"."extern_uid" IS NOT NULL AND "identities"."provider" = 'crowd' LIMIT 1 /*application:web,correlation_id:01F5YF3JKFYABTR19KF4YWG076,endpoint_id:ProjectsController#show,line:/app/models/user.rb:1214:in `crowd_user?'*/ 0.909ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.887ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"fork_networks"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 0.847ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"fork_network_members"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 0.814ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.765ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.755ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.751ms SELECT "appearances".* FROM "appearances" ORDER BY "appearances"."id" ASC LIMIT 1 Cached 0.747ms SELECT "appearances".* FROM "appearances" ORDER BY "appearances"."id" ASC LIMIT 1 Cached 0.739ms SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 26 AND "routes"."source_type" = 'Namespace' LIMIT 1 Cached 0.735ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.726ms SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod, c.collname, col_description(a.attrelid, a.attnum) AS comment FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum LEFT JOIN pg_type t ON a.atttypid = t.oid LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation WHERE a.attrelid = '"repository_languages"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum 0.721ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.719ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.716ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.708ms SELECT 1 AS one FROM "identities" WHERE "identities"."user_id" = 1 AND (provider LIKE 'ldap%' AND extern_uid IS NOT NULL) LIMIT 1 Cached 0.706ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.701ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.7ms SELECT 1 AS one FROM "identities" WHERE "identities"."user_id" = 1 AND (provider LIKE 'ldap%' AND extern_uid IS NOT NULL) LIMIT 1 Cached 0.689ms SELECT 1 AS one FROM "projects" WHERE "projects"."namespace_id" IN (WITH RECURSIVE "base_and_descendants" AS ((SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 26) UNION (SELECT "namespaces".* FROM "namespaces", "base_and_descendants" WHERE "namespaces"."type" = 'Group' AND "namespaces"."parent_id" = "base_and_descendants"."id")) SELECT id FROM "base_and_descendants" AS "namespaces") AND "projects"."shared_runners_enabled" = TRUE LIMIT 1 Cached 0.684ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.68ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.669ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.664ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.658ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.639ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.635ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.635ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.634ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.614ms SELECT a.attname FROM ( SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx FROM pg_index WHERE indrelid = '"protected_branches"'::regclass AND indisprimary ) i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[i.idx] ORDER BY i.idx 0.609ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.604ms SELECT 1 AS one FROM "identities" WHERE "identities"."user_id" = 1 AND "identities"."extern_uid" IS NOT NULL AND "identities"."provider" = 'crowd' LIMIT 1 Cached 0.601ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.59ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.585ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.582ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached 0.58ms SELECT "licenses".* FROM "licenses" ORDER BY "licenses"."id" DESC LIMIT 100 Cached [ "ee/lib/ee/peek/views/active_record.rb:11:in `generate_detail'", "lib/peek/views/active_record.rb:52:in `block in setup_subscribers'", "ee/app/models/license.rb:302:in `load_license'", "ee/app/models/license.rb:281:in `block in current'", "lib/gitlab/json_cache.rb:51:in `fetch'", "ee/app/models/license.rb:281:in `current'", "ee/app/models/ee/application_setting.rb:372:in `instance_review_permitted?'", "lib/gitlab/current_settings.rb:28:in `method_missing'", "app/helpers/application_helper.rb:218:in `instance_review_permitted?'", "app/views/shared/_user_dropdown_instance_review.html.haml:1", "app/views/layouts/header/_current_user_dropdown.html.haml:45", "app/views/layouts/header/_default.html.haml:107", "app/views/layouts/application.html.haml:12", "app/views/layouts/project.html.haml:17", "app/controllers/application_controller.rb:128:in `render'", "app/controllers/application_controller.rb:541:in `block in allow_gitaly_ref_name_caching'", "lib/gitlab/gitaly_client.rb:341:in `allow_ref_name_caching'", "app/controllers/application_controller.rb:540:in `allow_gitaly_ref_name_caching'", "ee/lib/gitlab/ip_address_state.rb:10:in `with'", "ee/app/controllers/ee/application_controller.rb:40:in `set_current_ip_address'", "app/controllers/application_controller.rb:490:in `set_current_admin'", "lib/gitlab/session.rb:11:in `with_session'", "app/controllers/application_controller.rb:481:in `set_session_storage'", "app/controllers/application_controller.rb:475:in `set_locale'", "app/controllers/application_controller.rb:468:in `block in set_current_context'", "lib/gitlab/application_context.rb:70:in `block in use'", "lib/gitlab/application_context.rb:70:in `use'", "lib/gitlab/application_context.rb:27:in `with_context'", "app/controllers/application_controller.rb:459:in `set_current_context'", "lib/gitlab/jira/middleware.rb:19:in `call'" ] 0.573ms SELECT a.attname FROM ( SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx FROM pg_index WHERE indrelid = '"tags"'::regclass AND indisprimary ) i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[i.idx] ORDER BY i.idx 0.567ms SELECT a.attname FROM ( SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx FROM pg_index WHERE indrelid = '"fork_networks"'::regclass AND indisprimary ) i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[i.idx] ORDER BY i.idx 0.516ms SELECT a.attname FROM ( SELECT indrelid, indkey, generate_subscripts(indkey, 1) idx FROM pg_index WHERE indrelid = '"notification_settings"'::regclass AND indisprimary ) i JOIN pg_attribute a ON a.attrelid = i.indrelid AND a.attnum = i.indkey[i.idx] ORDER BY i.idx ``` ---- # Proposal It seems that the use of JsonCache alone with a SafeRequestStore is not doing a good job here. What we could perhaps be doing is using that to populate a RequestCache instead. So we pay the JsonCache price once per request. cc @stanhu
issue