When using issueMoveList GraphQL to move an issue between epic swimlanes and also move an issue between lists (IOW diagonally), then number of SQL queries exceeds 100 limit.
Reproducible by:
comment out query limit disablement in app/graphql/mutations/boards/issues/issue_move_list.rb
run rspec ee/spec/requests/api/graphql/mutations/boards/issues/issue_move_list_spec.rb
In general the problem is that Issue::UpdateService becomes overloaded with additional features which can be updated when updating the issue. Currently the request (in the spec) does 135 queries. There is no simple solution w/o doing some bigger refactoring, but we can consider following approaches to limit the overall count:
move as much as possible "hook-related-stuff" into an async worker - these might be: todos creation/cleanup, issue metrics (ensure_metrics) callback, maybe system notifications? Though this will save enough queries to get under 100 queries limit.
cache some queries - the impact though would be relatively small (given we are hitting the limit in the spec itself)
consider using more lightweight separate service for moving issues between board lists (instead of Issues::UpdateService) - I'm not sure though if this is a good idea because moving an issue between lists actually updates issue itself (relative position, epic_id, labels/assigness...)
@johnhope@cdybenko I've updated description with details about possible optimizations.
Note that moving issues between swimlanes is not high-traffic query (60 requests per day - https://log.gprd.gitlab.net/goto/b1c71eb57add9257a25941bef74c4549) so I think that impact on overall performance is quite minimal. So maybe we may prioritize some other performance optimizations before this one?
I can pick this one up. I'm out tomorrow and Monday but will make it my P1 as soon as I'm back. If there is higher urgency feel free to steal it back from me :-)
I've spent about 2 days on this now on and off, and I'm not really getting anywhere. The problem is that there are about a dozen domain services involved in moving an issue this way and there isn't any obvious low hanging fruit to reduce query count AFAICT.
The original suggestion to move logic into jobs instead sounds like the most promising approach, but it is difficult for me to say what needs or need not to happen synchronously for the UX not to feel broken. This is complicated by the typical CE/EE split of the involved classes.
I think for me to make tangible progress I'd spend another week even understanding what all these things do, which isn't productive. I would therefore suggest to re-assign to the team responsible for issue management (~"group::plan"?) and suggest a refactor of the service stack that moves all INSERTs, UPDATEs and DELETEs out of the request path unless they are critical to rendering the moved issue.
@mkaeppler This approach sounds correct to me. From the issue description:
There is no simple solution w/o doing some bigger refactoring, but we can consider following approaches to limit the overall count:
It sounds like you've come to the conclusion that a larger refactor is needed and the amount of effort involved is not worth it from a non ~"group::plan" member.
I'm making very slow progress on this. So far I'm mostly trying to understand what all the constituents do that are involved in moving issues. But I can confirm that Issues::UpdateService appears to contribute the most queries. I used marginalia to annotate queries so they can be attributed to the calling class and the distribution is as follows:
This is not exhaustive since these annotations are places manually around those methods I identified as entry points but there could be more going on (esp. since clearly 84 + 4 < 100)
Here is a list of queries that happen in IssueMoveList#resolve and its children and their counts:
expand
4 SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = $1 AND "namespaces"."id" = $2 LIMIT $3[0m [["type", "Group"], ["id", 1], ["LIMIT", 1]] 3 SELECT SUM("timelogs"."time_spent") FROM "timelogs" WHERE "timelogs"."issue_id" = $1[0m [["issue_id", 3]] 3 SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = $1 AND "routes"."source_type" = $2 LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["source_id", 1], ["source_type", "Namespace"], ["LIMIT", 1]] 2 SELECT TRUE FROM issue_assignees WHERE user_id = 3 AND issue_id = issues.id) 2 SELECT SUM("timelogs"."time_spent") FROM "timelogs" WHERE "timelogs"."issue_id" = $1 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["issue_id", 3]] 2 SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2[0m [["id", 1], ["LIMIT", 1]] 2 SELECT "namespaces".* FROM "namespaces" INNER JOIN "projects" ON "namespaces"."id" = "projects"."namespace_id" WHERE "projects"."id" = $1 LIMIT $2[0m [["id", 1], ["LIMIT", 1]] 2 SELECT "labels".* FROM "labels" INNER JOIN "label_links" ON "labels"."id" = "label_links"."label_id" WHERE "label_links"."target_id" = $1 AND "label_links"."target_type" = $2 ORDER BY "labels"."title" ASC /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["target_id", 3], ["target_type", "Issue"]] 2 SELECT "issues".* FROM "issues" INNER JOIN "projects" ON "projects"."id" = "issues"."project_id" LEFT JOIN project_features ON projects.id = project_features.project_id WHERE ( 2 SELECT "epics".* FROM "epics" INNER JOIN "epic_issues" ON "epics"."id" = "epic_issues"."epic_id" WHERE "epic_issues"."issue_id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["issue_id", 3], ["LIMIT", 1]] 1 UPDATE "todos" SET "state" = $1, "resolved_by_action" = $2, "updated_at" = $3 WHERE "todos"."user_id" = $4 AND ("todos"."state" IN ('pending')) AND "todos"."project_id" = $5 AND "todos"."target_id" = $6 AND "todos"."target_type" = $7 AND "todos"."state" != $8 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["state", "done"], ["resolved_by_action", 0], ["updated_at", "2021-04-07 14:20:59.565531"], ["user_id", 3], ["project_id", 1], ["target_id", 3], ["target_type", "Issue"], ["state", "done"]] 1 UPDATE "issues" SET "relative_position" = $1 WHERE "issues"."id" = $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["relative_position", 30], ["id", 3]] 1 UPDATE "issue_metrics" SET "first_added_to_board_at" = $1, "updated_at" = $2 WHERE "issue_metrics"."id" = $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["first_added_to_board_at", "2021-04-07 14:20:59.504518"], ["updated_at", "2021-04-07 14:20:59.504906"], ["id", 3]] 1 UPDATE "epics" SET "updated_at" = $1 WHERE "epics"."id" = $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["updated_at", "2021-04-07 14:20:59.119507"], ["id", 1]] 1 SELECT "web_hooks".* FROM "web_hooks" WHERE "web_hooks"."type" = $1 AND "web_hooks"."project_id" = $2 AND "web_hooks"."issues_events" = $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["type", "ProjectHook"], ["project_id", 1], ["issues_events", true]] 1 SELECT "web_hooks".* FROM "web_hooks" WHERE "web_hooks"."type" = $1 AND "web_hooks"."group_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE "namespaces"."type" = $2 AND "namespaces"."id" = $3) AND "web_hooks"."issues_events" = $4 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["type", "GroupHook"], ["type", "Group"], ["id", 1], ["issues_events", true]] 1 SELECT "users"."id" FROM "users" INNER JOIN "issue_assignees" ON "users"."id" = "issue_assignees"."user_id" WHERE "issue_assignees"."issue_id" = $1 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService*/[0m [["issue_id", 3]] 1 SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 2], ["LIMIT", 1]] 1 SELECT "users".* FROM "users" INNER JOIN "issue_assignees" ON "users"."id" = "issue_assignees"."user_id" WHERE "issue_assignees"."issue_id" = $1 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["issue_id", 3]] 1 SELECT "user_agent_details".* FROM "user_agent_details" WHERE "user_agent_details"."subject_id" = $1 AND "user_agent_details"."subject_type" = $2 LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["subject_id", 3], ["subject_type", "Issue"], ["LIMIT", 1]] 1 SELECT "todos"."id" FROM "todos" WHERE "todos"."user_id" = $1 AND ("todos"."state" IN ('pending')) AND "todos"."project_id" = $2 AND "todos"."target_id" = $3 AND "todos"."target_type" = $4 AND "todos"."state" != $5 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["user_id", 3], ["project_id", 1], ["target_id", 3], ["target_type", "Issue"], ["state", "done"]] 1 SELECT "system_note_metadata".* FROM "system_note_metadata" WHERE "system_note_metadata"."note_id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["note_id", 2], ["LIMIT", 1]] 1 SELECT "system_note_metadata".* FROM "system_note_metadata" WHERE "system_note_metadata"."note_id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["note_id", 1], ["LIMIT", 1]] 1 SELECT "services".* FROM "services" WHERE "services"."project_id" = $1 AND "services"."issues_events" = $2 AND "services"."active" = $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["project_id", 1], ["issues_events", true], ["active", true]] 1 SELECT "saml_providers".* FROM "saml_providers" WHERE "saml_providers"."group_id" = $1 LIMIT $2[0m [["group_id", 1], ["LIMIT", 1]] 1 SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = $1 AND "routes"."source_type" = $2 LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["source_id", 1], ["source_type", "Project"], ["LIMIT", 1]] 1 SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = $1 AND "routes"."source_type" = $2 LIMIT $3[0m [["source_id", 1], ["source_type", "Namespace"], ["LIMIT", 1]] 1 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"."autoclose_referenced_issues" AS t0_r80, "projects"."suggestion_commit_message" 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, "namespaces"."id" AS t2_r0, "namespaces"."name" AS t2_r1, "namespaces"."path" AS t2_r2, "namespaces"."owner_id" AS t2_r3, "namespaces"."created_at" AS t2_r4, "namespaces"."updated_at" AS t2_r5, "namespaces"."type" AS t2_r6, "namespaces"."description" AS t2_r7, "namespaces"."avatar" AS t2_r8, "namespaces"."membership_lock" AS t2_r9, "namespaces"."share_with_group_lock" AS t2_r10, "namespaces"."visibility_level" AS t2_r11, "namespaces"."request_access_enabled" AS t2_r12, "namespaces"."ldap_sync_status" AS t2_r13, "namespaces"."ldap_sync_error" AS t2_r14, "namespaces"."ldap_sync_last_update_at" AS t2_r15, "namespaces"."ldap_sync_last_successful_update_at" AS t2_r16, "namespaces"."ldap_sync_last_sync_at" AS t2_r17, "namespaces"."description_html" AS t2_r18, "namespaces"."lfs_enabled" AS t2_r19, "namespaces"."parent_id" AS t2_r20, "namespaces"."shared_runners_minutes_limit" AS t2_r21, "namespaces"."repository_size_limit" AS t2_r22, "namespaces"."require_two_factor_authentication" AS t2_r23, "namespaces"."two_factor_grace_period" AS t2_r24, "namespaces"."cached_markdown_version" AS t2_r25, "namespaces"."project_creation_level" AS t2_r26, "namespaces"."runners_token" AS t2_r27, "namespaces"."file_template_project_id" AS t2_r28, "namespaces"."saml_discovery_token" AS t2_r29, "namespaces"."runners_token_encrypted" AS t2_r30, "namespaces"."custom_project_templates_group_id" AS t2_r31, "namespaces"."auto_devops_enabled" AS t2_r32, "namespaces"."extra_shared_runners_minutes_limit" AS t2_r33, "namespaces"."last_ci_minutes_notification_at" AS t2_r34, "namespaces"."last_ci_minutes_usage_notification_level" AS t2_r35, "namespaces"."subgroup_creation_level" AS t2_r36, "namespaces"."emails_disabled" AS t2_r37, "namespaces"."max_pages_size" AS t2_r38, "namespaces"."max_artifacts_size" AS t2_r39, "namespaces"."mentions_disabled" AS t2_r40, "namespaces"."default_branch_protection" AS t2_r41, "namespaces"."unlock_membership_to_ldap" AS t2_r42, "namespaces"."max_personal_access_token_lifetime" AS t2_r43, "namespaces"."push_rule_id" AS t2_r44, "namespaces"."shared_runners_enabled" AS t2_r45, "namespaces"."allow_descendants_override_disabled_shared_runners" AS t2_r46, "namespaces"."traversal_ids" AS t2_r47 FROM "projects" LEFT OUTER JOIN "routes" ON "routes"."source_type" = $1 AND "routes"."source_id" = "projects"."id" LEFT OUTER JOIN "namespaces" ON "namespaces"."id" = "projects"."namespace_id" WHERE ((LOWER(routes.path) = LOWER('group1/project1'))) /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["source_type", "Project"]] 1 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"."autoclose_referenced_issues" AS t0_r80, "projects"."suggestion_commit_message" 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" = $1 AND "routes"."source_id" = "projects"."id" WHERE ((LOWER(routes.path) = LOWER('group1/project1'))) /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList*/[0m [["source_type", "Project"]] 1 SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 1], ["LIMIT", 1]] 1 SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList*/[0m [["id", 1], ["LIMIT", 1]] 1 SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList*/[0m [["project_id", 1], ["LIMIT", 1]] 1 SELECT "namespaces"."id" AS t0_r0, "namespaces"."name" AS t0_r1, "namespaces"."path" AS t0_r2, "namespaces"."owner_id" AS t0_r3, "namespaces"."created_at" AS t0_r4, "namespaces"."updated_at" AS t0_r5, "namespaces"."type" AS t0_r6, "namespaces"."description" AS t0_r7, "namespaces"."avatar" AS t0_r8, "namespaces"."membership_lock" AS t0_r9, "namespaces"."share_with_group_lock" AS t0_r10, "namespaces"."visibility_level" AS t0_r11, "namespaces"."request_access_enabled" AS t0_r12, "namespaces"."ldap_sync_status" AS t0_r13, "namespaces"."ldap_sync_error" AS t0_r14, "namespaces"."ldap_sync_last_update_at" AS t0_r15, "namespaces"."ldap_sync_last_successful_update_at" AS t0_r16, "namespaces"."ldap_sync_last_sync_at" AS t0_r17, "namespaces"."description_html" AS t0_r18, "namespaces"."lfs_enabled" AS t0_r19, "namespaces"."parent_id" AS t0_r20, "namespaces"."shared_runners_minutes_limit" AS t0_r21, "namespaces"."repository_size_limit" AS t0_r22, "namespaces"."require_two_factor_authentication" AS t0_r23, "namespaces"."two_factor_grace_period" AS t0_r24, "namespaces"."cached_markdown_version" AS t0_r25, "namespaces"."project_creation_level" AS t0_r26, "namespaces"."runners_token" AS t0_r27, "namespaces"."file_template_project_id" AS t0_r28, "namespaces"."saml_discovery_token" AS t0_r29, "namespaces"."runners_token_encrypted" AS t0_r30, "namespaces"."custom_project_templates_group_id" AS t0_r31, "namespaces"."auto_devops_enabled" AS t0_r32, "namespaces"."extra_shared_runners_minutes_limit" AS t0_r33, "namespaces"."last_ci_minutes_notification_at" AS t0_r34, "namespaces"."last_ci_minutes_usage_notification_level" AS t0_r35, "namespaces"."subgroup_creation_level" AS t0_r36, "namespaces"."emails_disabled" AS t0_r37, "namespaces"."max_pages_size" AS t0_r38, "namespaces"."max_artifacts_size" AS t0_r39, "namespaces"."mentions_disabled" AS t0_r40, "namespaces"."default_branch_protection" AS t0_r41, "namespaces"."unlock_membership_to_ldap" AS t0_r42, "namespaces"."max_personal_access_token_lifetime" AS t0_r43, "namespaces"."push_rule_id" AS t0_r44, "namespaces"."shared_runners_enabled" AS t0_r45, "namespaces"."allow_descendants_override_disabled_shared_runners" AS t0_r46, "namespaces"."traversal_ids" AS t0_r47, "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 "namespaces" LEFT OUTER JOIN "routes" ON "routes"."source_type" = $1 AND "routes"."source_id" = "namespaces"."id" WHERE "namespaces"."type" = $2 AND ((LOWER(routes.path) = LOWER('group1'))) /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["source_type", "Namespace"], ["type", "Group"]] 1 SELECT "namespaces".* FROM (SELECT "namespaces".* FROM "namespaces" INNER JOIN (SELECT "id", "depth" FROM (WITH RECURSIVE "base_and_ancestors" AS ((SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 1) 1 SELECT "namespaces".* FROM "namespaces" WHERE (traversal_ids @> (SELECT traversal_ids as latest_traversal_ids FROM "namespaces" WHERE (id = (1)))) /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m 1 SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 1) 1 SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = $1 AND "namespaces"."id" = $2 AND "namespaces"."type" = $3 LIMIT $4 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["type", "Group"], ["id", 1], ["type", "Group"], ["LIMIT", 1]] 1 SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = $1 AND "namespaces"."id" = $2 AND "namespaces"."type" = $3 LIMIT $4 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList*/[0m [["type", "Group"], ["id", 1], ["type", "Group"], ["LIMIT", 1]] 1 SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = $1 AND "namespaces"."id" = $2 AND "namespaces"."type" = $3 LIMIT $4[0m [["type", "Group"], ["id", 1], ["type", "Group"], ["LIMIT", 1]] 1 SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 1], ["LIMIT", 1]] 1 SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList*/[0m [["id", 1], ["LIMIT", 1]] 1 SELECT "namespaces".* FROM "namespaces" INNER JOIN "projects" ON "namespaces"."id" = "projects"."namespace_id" WHERE "projects"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList*/[0m [["id", 1], ["LIMIT", 1]] 1 SELECT "namespaces".* FROM "namespaces", "base_and_descendants" WHERE "namespaces"."type" = 'Group' AND "namespaces"."parent_id" = "base_and_descendants"."id")) SELECT "namespaces".* FROM ((SELECT DISTINCT "namespaces".* FROM "base_and_ancestors" AS "namespaces" WHERE "namespaces"."type" = 'Group') 1 SELECT "namespaces".* FROM "namespaces", "base_and_ancestors" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = "base_and_ancestors"."parent_id")) SELECT DISTINCT "namespaces".*, ROW_NUMBER() OVER () as depth FROM "base_and_ancestors" AS "namespaces") AS "namespaces" WHERE "namespaces"."type" = 'Group') namespaces_join_table on namespaces_join_table.id = namespaces.id WHERE "namespaces"."type" = $1 ORDER BY "namespaces_join_table"."depth" ASC) AS "namespaces" WHERE "namespaces"."type" = $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["type", "Group"], ["type", "Group"]] 1 SELECT "namespaces".* FROM "namespaces", "base_and_ancestors" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = "base_and_ancestors"."parent_id")), "base_and_descendants" AS ((SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 1) 1 SELECT "namespace_settings".* FROM "namespace_settings" WHERE "namespace_settings"."namespace_id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["namespace_id", 1], ["LIMIT", 1]] 1 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" = $1 AND "project_authorizations"."user_id" = $2 GROUP BY "project_authorizations"."user_id" /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList*/[0m [["project_id", 1], ["user_id", 3]] 1 SELECT "lists".* FROM "lists" WHERE "lists"."label_id" = $1 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["label_id", 2]] 1 SELECT "lists".* FROM "lists" WHERE "lists"."board_id" = $1 AND "lists"."id" = $2 ORDER BY "lists"."list_type" ASC, "lists"."position" ASC LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService*/[0m [["board_id", 1], ["id", 3], ["LIMIT", 1]] 1 SELECT "lists".* FROM "lists" WHERE "lists"."board_id" = $1 AND "lists"."id" = $2 ORDER BY "lists"."list_type" ASC, "lists"."position" ASC LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService*/[0m [["board_id", 1], ["id", 2], ["LIMIT", 1]] 1 SELECT "labels"."id" FROM "labels" WHERE ("labels"."type" = 'GroupLabel' AND "labels"."group_id" IN (1) OR "labels"."type" = 'ProjectLabel' AND "labels"."project_id" = 1) AND "labels"."id" = $1 ORDER BY "labels"."title" ASC /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 2]] 1 SELECT "labels"."id" FROM "labels" WHERE ("labels"."type" = 'GroupLabel' AND "labels"."group_id" IN (1) OR "labels"."type" = 'ProjectLabel' AND "labels"."project_id" = 1) AND "labels"."id" = $1 ORDER BY "labels"."title" ASC /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 1]] 1 SELECT "labels".* FROM "labels" WHERE "labels"."id" = $1 ORDER BY "labels"."title" ASC /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 2]] 1 SELECT "issue_user_mentions".* FROM "issue_user_mentions" WHERE "issue_user_mentions"."issue_id" = $1 AND "issue_user_mentions"."note_id" = $2 ORDER BY "issue_user_mentions"."id" ASC LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["issue_id", 3], ["note_id", 2], ["LIMIT", 1]] 1 SELECT "issues".* FROM "issues" WHERE "issues"."project_id" IN (SELECT "projects"."id" FROM "projects" WHERE "projects"."namespace_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE (traversal_ids @> (SELECT traversal_ids as latest_traversal_ids FROM "namespaces" WHERE (id = (1)))))) AND "issues"."id" != $1 AND "issues"."relative_position" = $2 LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 3], ["relative_position", 30], ["LIMIT", 1]] 1 SELECT "issues".* FROM "issues" WHERE "issues"."project_id" = $1 AND "issues"."iid" = $2 ORDER BY "issues"."id" DESC LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList*/[0m [["project_id", 1], ["iid", 3], ["LIMIT", 1]] 1 SELECT "issues".* FROM "issues" WHERE "issues"."project_id" = $1 AND "issues"."iid" = $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["project_id", 1], ["iid", 3]] 1 SELECT "issues".* FROM "issues" WHERE "issues"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 3], ["LIMIT", 1]] 1 SELECT "issues".* FROM "issues" WHERE "issues"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList*/[0m [["id", 3], ["LIMIT", 1]] 1 SELECT "issues".* FROM "issues" INNER JOIN "epic_issues" ON "issues"."id" = "epic_issues"."issue_id" WHERE "epic_issues"."epic_id" = $1 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["epic_id", 1]] 1 SELECT "issue_metrics".* FROM "issue_metrics" WHERE "issue_metrics"."issue_id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["issue_id", 3], ["LIMIT", 1]] 1 SELECT "issue_metrics".* FROM "issue_metrics" WHERE "issue_metrics"."issue_id" = $1 LIMIT $2[0m [["issue_id", 3], ["LIMIT", 1]] 1 SELECT id, relative_position, epic_id as parent_id, epic_id, 'epic_issue' as object_type 1 SELECT "group_group_links".* FROM "group_group_links" WHERE "group_group_links"."shared_group_id" = 1) SELECT "members"."id", LEAST("group_group_links"."group_access", "members"."access_level") AS access_level, "members"."source_id", "members"."source_type", "members"."user_id", "members"."notification_level", "members"."type", "members"."created_at", "members"."updated_at", "members"."created_by_id", "members"."invite_email", "members"."invite_token", "members"."invite_accepted_at", "members"."requested_at", "members"."expires_at", "members"."ldap", "members"."override" FROM "members", "group_group_links_cte" AS "group_group_links" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "members"."requested_at" IS NULL AND "members"."source_id" = "group_group_links"."shared_with_group_id" AND "members"."source_type" = 'Namespace' AND (members.access_level > 5))) members LEFT OUTER JOIN "users" ON "members"."user_id" = "users"."id" WHERE "members"."type" = $1 AND "members"."source_type" = $2 AND (("members"."user_id" IS NULL AND "members"."invite_token" IS NOT NULL) OR "users"."state" = 'active') AND "members"."requested_at" IS NULL AND (members.access_level > 5) AND "members"."access_level" = $3 AND "members"."user_id" = $4 LIMIT $5 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["type", "GroupMember"], ["source_type", "Namespace"], ["access_level", 50], ["user_id", 3], ["LIMIT", 1]] 1 SELECT "grafana_integrations".* FROM "grafana_integrations" WHERE "grafana_integrations"."project_id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["project_id", 1], ["LIMIT", 1]] 1 SELECT "epic_user_mentions".* FROM "epic_user_mentions" WHERE "epic_user_mentions"."epic_id" = $1 AND "epic_user_mentions"."note_id" = $2 ORDER BY "epic_user_mentions"."id" ASC LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["epic_id", 1], ["note_id", 1], ["LIMIT", 1]] 1 SELECT "epics".* FROM "epics" WHERE "epics"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 1], ["LIMIT", 1]] 1 SELECT "epics".* FROM "epics" WHERE "epics"."group_id" = $1 AND "epics"."iid" = $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["group_id", 1], ["iid", 1]] 1 SELECT "epic_issues".* FROM "epic_issues" WHERE "epic_issues"."issue_id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["issue_id", 3], ["LIMIT", 1]] 1 SELECT "epic_issues"."epic_id", MIN(relative_position) AS position FROM ((SELECT id, relative_position, parent_id, parent_id as epic_id, 'epic' as object_type 1 SELECT DISTINCT "namespaces".* FROM "base_and_descendants" AS "namespaces" WHERE "namespaces"."type" = 'Group')) namespaces WHERE "namespaces"."type" = $1 ORDER BY "namespaces"."id" ASC LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["type", "Group"], ["LIMIT", 1]] 1 SELECT DISTINCT "epics".* FROM "epics" INNER JOIN "epic_issues" ON "epic_issues"."epic_id" = "epics"."id" WHERE "epic_issues"."issue_id" = $1 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["issue_id", 3]] 1 SELECT COUNT(*) FROM "todos" WHERE "todos"."user_id" = $1 AND ("todos"."state" IN ('pending')) /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["user_id", 3]] 1 SELECT COUNT(*) FROM "todos" WHERE "todos"."user_id" = $1 AND ("todos"."state" IN ('done')) /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["user_id", 3]] 1 SELECT "boards".* FROM "boards" WHERE "boards"."group_id" = $1 AND "boards"."id" = $2 LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService*/[0m [["group_id", 1], ["id", 1], ["LIMIT", 1]] 1 SELECT 1 FROM "project_authorizations" WHERE "project_authorizations"."user_id" = 3 AND (project_authorizations.project_id = issues.project_id) AND (project_authorizations.access_level >= 20))))) AND "projects"."namespace_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE (traversal_ids @> (SELECT traversal_ids as latest_traversal_ids FROM "namespaces" WHERE (id = (1))))) AND (EXISTS (SELECT 1 FROM "project_authorizations" WHERE "project_authorizations"."user_id" = 3 AND (project_authorizations.project_id = projects.id) AND (project_authorizations.access_level >= 10)) OR projects.visibility_level IN (10,20)) AND ("project_features"."issues_access_level" IS NULL OR "project_features"."issues_access_level" IN (20,30) OR ("project_features"."issues_access_level" = 10 AND EXISTS (SELECT 1 FROM "project_authorizations" WHERE "project_authorizations"."user_id" = 3 AND (project_authorizations.project_id = projects.id) AND (project_authorizations.access_level >= 10)))) AND "issues"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 2], ["LIMIT", 1]] 1 SELECT 1 FROM "project_authorizations" WHERE "project_authorizations"."user_id" = 3 AND (project_authorizations.project_id = issues.project_id) AND (project_authorizations.access_level >= 20))))) AND "projects"."namespace_id" IN (SELECT "namespaces"."id" FROM "namespaces" WHERE (traversal_ids @> (SELECT traversal_ids as latest_traversal_ids FROM "namespaces" WHERE (id = (1))))) AND (EXISTS (SELECT 1 FROM "project_authorizations" WHERE "project_authorizations"."user_id" = 3 AND (project_authorizations.project_id = projects.id) AND (project_authorizations.access_level >= 10)) OR projects.visibility_level IN (10,20)) AND ("project_features"."issues_access_level" IS NULL OR "project_features"."issues_access_level" IN (20,30) OR ("project_features"."issues_access_level" = 10 AND EXISTS (SELECT 1 FROM "project_authorizations" WHERE "project_authorizations"."user_id" = 3 AND (project_authorizations.project_id = projects.id) AND (project_authorizations.access_level >= 10)))) AND "issues"."id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["id", 1], ["LIMIT", 1]] 1 SELECT 1 AS one FROM ((SELECT "members".* FROM "members" LEFT OUTER JOIN "users" ON "members"."user_id" = "users"."id" WHERE "members"."type" = 'GroupMember' AND "members"."source_type" = 'Namespace' AND "users"."state" = 'active' AND "members"."requested_at" IS NULL AND "members"."invite_token" IS NULL AND (members.access_level > 5) AND (members.access_level > 5) AND "members"."source_id" = 1) 1 SELECT 1 AS one FROM "projects" WHERE "projects"."namespace_id" = $1 AND "projects"."id" = $2 LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["namespace_id", 1], ["id", 1], ["LIMIT", 1]] 1 SELECT 1 AS one FROM "projects" WHERE "projects"."namespace_id" = $1 AND "projects"."id" = $2 LIMIT $3[0m [["namespace_id", 1], ["id", 1], ["LIMIT", 1]] 1 SELECT 1 AS one FROM "epic_issues" WHERE "epic_issues"."issue_id" = $1 LIMIT $2 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["issue_id", 3], ["LIMIT", 1]] 1 SELECT 1 AS one FROM "epic_issues" WHERE "epic_issues"."issue_id" = $1 AND "epic_issues"."id" != $2 LIMIT $3 /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["issue_id", 3], ["id", 1], ["LIMIT", 1]] 1 INSERT INTO "system_note_metadata" ("note_id", "action", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["note_id", 2], ["action", "issue_added_to_epic"], ["created_at", "2021-04-07 14:20:59.293958"], ["updated_at", "2021-04-07 14:20:59.293958"]] 1 INSERT INTO "system_note_metadata" ("note_id", "action", "created_at", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["note_id", 1], ["action", "epic_issue_added"], ["created_at", "2021-04-07 14:20:59.184713"], ["updated_at", "2021-04-07 14:20:59.184713"]] 1 INSERT INTO resource_label_events ("issue_id", "user_id", "created_at", "label_id", "action") 1 INSERT INTO "notes" ("note", "noteable_type", "author_id", "created_at", "updated_at", "project_id", "noteable_id", "system", "discussion_id", "note_html", "cached_markdown_version") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) RETURNING "id" /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["note", "added to epic &1"], ["noteable_type", "Issue"], ["author_id", 3], ["created_at", "2021-04-07 14:20:59.198902"], ["updated_at", "2021-04-07 14:20:59.201704"], ["project_id", 1], ["noteable_id", 3], ["system", true], ["discussion_id", "e6daed2fd54ff8d458e130212819438268ef20c2"], ["note_html", "added to epic &1"], ["cached_markdown_version", 1769472]] 1 INSERT INTO "notes" ("note", "noteable_type", "author_id", "created_at", "updated_at", "noteable_id", "system", "discussion_id", "note_html", "cached_markdown_version") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING "id" /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["note", "added issue project1#3"], ["noteable_type", "Epic"], ["author_id", 3], ["created_at", "2021-04-07 14:20:58.919125"], ["updated_at", "2021-04-07 14:20:58.982117"], ["noteable_id", 1], ["system", true], ["discussion_id", "afe2c7ffe920214b658b2c8f67c7f508163e6d22"], ["note_html", "added issue project1#3"], ["cached_markdown_version", 1769472]] 1 INSERT INTO "label_links" ("label_id", "target_id", "target_type", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["label_id", 2], ["target_id", 3], ["target_type", "Issue"], ["created_at", "2021-04-07 14:20:59.426149"], ["updated_at", "2021-04-07 14:20:59.426149"]] 1 INSERT INTO "epic_issues" ("epic_id", "issue_id", "relative_position") VALUES ($1, $2, $3) RETURNING "id" /*application:test,correlation_id:1fe15d57-2b7d-44e3-99fe-07fce6e581ca,endpoint_id:GraphqlController#execute*/ /*> IssueMoveList > BaseItemMoveService > Issues::UpdateService*/[0m [["epic_id", 1], ["issue_id", 3], ["relative_position", 0]]
While there are some duplicate queries, there isn't really anything "chunky" that would move the needle. Also the usual suspects namespace and routes queries that we tend to repeat everywhere are present, but they are usually hard to optimize and fast in production.
I think our best bet might be to slim down the services involved and move out as much as we can to sidekiq workers.
Thanks for the investigation @mkaeppler, I'll move it back into groupproduct planning in case one of the team has an idea for how to refactor, for example putting some of the services into background jobs.
@cdu1 We won't get to this in %13.11 given that it hasn't been started yet and isn't as high priority as the other performance work we're doing. I'd expect we'll get to it in %13.12 or %14.0
@cdu1 This hasn't started yet, though it's next up in our workflowready for development queue. I would consider it at risk and will adjust the due date later in the week if it's going to slip.
Re-taking this one to take another look as it's on top of our ready-for-dev list (though I suspect that more significant refactoring will be needed to move this forward :( )