Linked Items BE: Decrease number of SQL queries executed by workItemAddLinkedItems mutation
When linking work items using workItemAddLinkedItems
mutation the number of SQL queries exceeds the 100 limit if we link more than 1 item at a time. In order to unblock the feature development we used Gitlab::QueryLimiting.disable!
and implemented a limit of 5 for the number of items that can be linked. This is a temporary solution and should be resolved before enabling the feature flag linked_work_items
.
The current number of queries executed (in the spec) when linking 3 items (maximum allowed) is 134, with a large number being attributed to creating the system notes. Each additional item increases the count by ~32 queries. If we skip the notes creation the count is increased by ~10 queries by item.
We had a similar problem when creating epic-issue links within a mutation and was addressed by moving some steps from the service to an async job. We can explore a similar solution for the RelatedWorkItemLinks::CreateService
service.
queries log
Gitlab::QueryLimiting::Transaction::ThresholdExceededError:
Too many SQL queries were executed in GraphqlController#execute (application/json): a maximum of 100 is allowed but 134 SQL queries were executed
0: SELECT "personal_access_tokens".* FROM "personal_access_tokens" WHERE "personal_access_tokens"."token_digest" = 'AQsvN6aBQgeN/w3zTysxkkLHMIWubfmS829P+Fdfoec=' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/models/concerns/token_authenticatable_strategies/digest.rb:12:in `find_token_authenticatable'*/
1: UPDATE "personal_access_tokens" SET "last_used_at" = '2023-08-10 17:10:59.367236' WHERE "personal_access_tokens"."id" = 67 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/services/personal_access_tokens/last_used_service.rb:15:in `execute'*/
2: SELECT "users".* FROM "users" WHERE "users"."id" = 99 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/lib/gitlab/auth/auth_finders.rb:133:in `find_user_from_web_access_token'*/
3: SELECT "user_details"."user_id", "user_details"."job_title", "user_details"."bio", "user_details"."webauthn_xid", "user_details"."provisioned_by_group_id", "user_details"."pronouns", "user_details"."pronunciation", "user_details"."registration_objective", "user_details"."phone", "user_details"."linkedin", "user_details"."twitter", "user_details"."skype", "user_details"."website_url", "user_details"."location", "user_details"."organization", "user_details"."password_last_changed_at", "user_details"."onboarding_step_url", "user_details"."discord", "user_details"."enterprise_group_id", "user_details"."enterprise_group_associated_at", "user_details"."email_reset_offered_at" FROM "user_details" WHERE "user_details"."user_id" = 99 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/models/user.rb:2139:in `user_detail'*/
4: SELECT "user_synced_attributes_metadata".* FROM "user_synced_attributes_metadata" WHERE "user_synced_attributes_metadata"."user_id" = 99 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/services/users/update_service.rb:91:in `discard_synced_attributes'*/
5: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/models/user.rb:1645:in `ensure_namespace_correct'*/
6: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."owner_id" = 99 AND "namespaces"."type" = 'User' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/models/user.rb:1645:in `ensure_namespace_correct'*/
7: UPDATE "users" SET "sign_in_count" = 1, "current_sign_in_at" = '2023-08-10 17:10:59.371077', "last_sign_in_at" = '2023-08-10 17:10:59.371077', "current_sign_in_ip" = '127.0.0.1', "last_sign_in_ip" = '127.0.0.1', "updated_at" = '2023-08-10 17:10:59.554500' WHERE "users"."id" = 99 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/services/users/update_service.rb:37:in `execute'*/
8: INSERT INTO "user_details" ("user_id") VALUES (99) RETURNING "user_id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/services/users/update_service.rb:37:in `execute'*/
9: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/services/users/update_service.rb:37:in `execute'*/
10: SELECT "emails"."email" FROM "emails" WHERE "emails"."user_id" = 99 AND "emails"."confirmed_at" IS NOT NULL /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/models/user.rb:1602:in `verified_emails'*/
11: SELECT "user_preferences"."id", "user_preferences"."user_id", "user_preferences"."issue_notes_filter", "user_preferences"."merge_request_notes_filter", "user_preferences"."created_at", "user_preferences"."updated_at", "user_preferences"."epics_sort", "user_preferences"."roadmap_epics_state", "user_preferences"."epic_notes_filter", "user_preferences"."issues_sort", "user_preferences"."merge_requests_sort", "user_preferences"."roadmaps_sort", "user_preferences"."first_day_of_week", "user_preferences"."timezone", "user_preferences"."time_display_relative", "user_preferences"."projects_sort", "user_preferences"."show_whitespace_in_diffs", "user_preferences"."sourcegraph_enabled", "user_preferences"."setup_for_company", "user_preferences"."render_whitespace_in_code", "user_preferences"."tab_width", "user_preferences"."view_diffs_file_by_file", "user_preferences"."gitpod_enabled", "user_preferences"."markdown_surround_selection", "user_preferences"."diffs_deletion_color", "user_preferences"."diffs_addition_color", "user_preferences"."markdown_automatic_lists", "user_preferences"."use_new_navigation", "user_preferences"."achievements_enabled", "user_preferences"."pinned_nav_items", "user_preferences"."pass_user_identities_to_ci_jwt", "user_preferences"."enabled_following", "user_preferences"."visibility_pipeline_id_type", "user_preferences"."project_shortcut_buttons", "user_preferences"."enabled_zoekt" FROM "user_preferences" WHERE "user_preferences"."user_id" = 99 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/models/user.rb:2135:in `user_preference'*/
12: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/services/users/activity_service.rb:40:in `record_activity'*/
13: UPDATE "users" SET "updated_at" = '2023-08-10 17:10:59.705864', "last_activity_on" = '2023-08-10' WHERE "users"."id" = 99 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/services/users/activity_service.rb:40:in `record_activity'*/
14: INSERT INTO "user_preferences" ("user_id", "created_at", "updated_at") VALUES (99, '2023-08-10 17:10:59.709046', '2023-08-10 17:10:59.709046') RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/services/users/activity_service.rb:40:in `record_activity'*/
15: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/services/users/activity_service.rb:40:in `record_activity'*/
16: SELECT "emails"."email" FROM "emails" WHERE "emails"."user_id" = 99 AND "emails"."confirmed_at" IS NOT NULL /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:GraphqlController#execute,db_config_name:main,line:/app/models/user.rb:1602:in `verified_emails'*/
17: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."id" = 195 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/gitlab/graphql/loaders/batch_model_loader.rb:25:in `block in find'*/
18: SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_last_update_at", "projects"."mirror_last_successful_update_at", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."pull_mirror_branch_prefix", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 54 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/policies/issuable_policy.rb:62:in `subject_container'*/
19: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 153 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/ee/app/policies/ee/project_policy.rb:527:in `block (2 levels) in <module:ProjectPolicy>'*/
20: SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 54 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/policies/project_policy.rb:989:in `access_allowed_to?'*/
21: 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" = 54 AND "project_authorizations"."user_id" = 99 GROUP BY "project_authorizations"."user_id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/project_team.rb:192:in `block in max_member_access_for_user_ids'*/
22: SELECT "users".* FROM "users" WHERE "users"."id" = 98 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/issue.rb:710:in `hidden?'*/
23: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."id" = 196 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/graphql/mutations/work_items/linked_items/add.rb:20:in `map'*/
24: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."id" = 197 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/graphql/mutations/work_items/linked_items/add.rb:20:in `map'*/
25: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."id" = 198 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/graphql/mutations/work_items/linked_items/add.rb:20:in `map'*/
26: SELECT issues.*, issue_links.id AS issue_link_id, issue_links.link_type as issue_link_type_value, issue_links.target_id as issue_link_source_id, issue_links.created_at as issue_link_created_at, issue_links.updated_at as issue_link_updated_at FROM "issues" INNER JOIN issue_links ON
(issue_links.source_id = issues.id AND issue_links.target_id = 195)
OR
(issue_links.target_id = issues.id AND issue_links.source_id = 195) ORDER BY issue_link_id /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/ability.rb:46:in `block in issues_readable_by_user'*/
27: SELECT "issue_links".* FROM "issue_links" WHERE "issue_links"."source_id" = 195 AND "issue_links"."target_id" = 196 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:43:in `relate_issuables'*/
28: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
29: SELECT 1 AS one FROM "issue_links" WHERE "issue_links"."source_id" = 195 AND "issue_links"."target_id" = 196 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
30: SELECT "issue_links".* FROM "issue_links" WHERE "issue_links"."source_id" = 196 AND "issue_links"."target_id" = 195 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/issuable_link.rb:55:in `check_opposite_relation'*/
31: SELECT 1 AS one FROM "work_item_parent_links" WHERE "work_item_parent_links"."work_item_parent_id" IN (195, 196) AND "work_item_parent_links"."work_item_id" IN (195, 196) LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/linkable_item.rb:29:in `check_existing_parent_link'*/
32: INSERT INTO "issue_links" ("source_id", "target_id", "created_at", "updated_at") VALUES (195, 196, '2023-08-10 17:10:59.792628', '2023-08-10 17:10:59.792628') RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
33: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
34: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/issue.rb:490:in `to_reference'*/
35: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 153 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb:220:in `get_params_from_container'*/
36: SELECT "plans".* FROM "plans" WHERE "plans"."name" = 'default' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/plan.rb:17:in `block in default'*/
37: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
38: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 54 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
39: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."project_id" = 54 AND "issues"."iid" = 2 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
40: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
41: SELECT "work_item_types".* FROM "work_item_types" WHERE "work_item_types"."id" = 281 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
42: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 153 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
43: 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 ('marked this work item as related to #2', 'Issue', 99, '2023-08-10 17:10:59.806629', '2023-08-10 17:10:59.825778', 54, 195, TRUE, 'add5b79afa6967e9467323198e8606b06809524c', '<p data-sourcepos="1:1-1:38" dir="auto">marked this work item as related to <a href="/namespace1/project-1/-/issues/2" data-reference-type="issue" data-original="#2" data-link="false" data-link-reference="false" data-project="54" data-issue="196" data-project-path="namespace1/project-1" data-iid="2" data-issue-type="issue" data-container="body" data-placement="top" title="My title 2" class="gfm gfm-issue">#2</a></p>', 2097152) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
44: INSERT INTO "system_note_metadata" ("action", "created_at", "updated_at", "note_id") VALUES ('relate', '2023-08-10 17:10:59.860279', '2023-08-10 17:10:59.860279', 147) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
45: DELETE FROM "issue_user_mentions" WHERE "issue_user_mentions"."issue_id" = 195 AND "issue_user_mentions"."note_id" = 147 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/cache_markdown_field.rb:182:in `store_mentions!'*/
46: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
47: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/issue.rb:490:in `to_reference'*/
48: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 153 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb:220:in `get_params_from_container'*/
49: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
50: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 54 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
51: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."project_id" = 54 AND "issues"."iid" = 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
52: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
53: SELECT "work_item_types".* FROM "work_item_types" WHERE "work_item_types"."id" = 281 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
54: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 153 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/inline_observability_filter.rb:55:in `group'*/
55: 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 ('marked this work item as related to #1', 'Issue', 99, '2023-08-10 17:10:59.875206', '2023-08-10 17:10:59.875789', 54, 196, TRUE, 'e7995f85c92c92cc0f362e556d39cae9e794278b', '<p data-sourcepos="1:1-1:38" dir="auto">marked this work item as related to <a href="/namespace1/project-1/-/issues/1" data-reference-type="issue" data-original="#1" data-link="false" data-link-reference="false" data-project="54" data-issue="195" data-project-path="namespace1/project-1" data-iid="1" data-issue-type="issue" data-container="body" data-placement="top" title="My title 1" class="gfm gfm-issue">#1</a></p>', 2097152) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
56: INSERT INTO "system_note_metadata" ("action", "created_at", "updated_at", "note_id") VALUES ('relate', '2023-08-10 17:10:59.900549', '2023-08-10 17:10:59.900549', 148) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
57: DELETE FROM "issue_user_mentions" WHERE "issue_user_mentions"."issue_id" = 196 AND "issue_user_mentions"."note_id" = 148 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/cache_markdown_field.rb:182:in `store_mentions!'*/
58: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
59: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 153 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
60: SELECT 1 AS one FROM "issue_links" WHERE "issue_links"."source_id" = 195 AND "issue_links"."id" != 144 AND "issue_links"."target_id" = 196 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:79:in `block in link_issuables'*/
61: SELECT "issue_links".* FROM "issue_links" WHERE "issue_links"."source_id" = 196 AND "issue_links"."target_id" = 195 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/issuable_link.rb:55:in `check_opposite_relation'*/
62: SELECT 1 AS one FROM "work_item_parent_links" WHERE "work_item_parent_links"."work_item_parent_id" IN (195, 196) AND "work_item_parent_links"."work_item_id" IN (195, 196) LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/linkable_item.rb:29:in `check_existing_parent_link'*/
63: SELECT "issue_links".* FROM "issue_links" WHERE "issue_links"."source_id" = 195 AND "issue_links"."target_id" = 197 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:43:in `relate_issuables'*/
64: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
65: SELECT 1 AS one FROM "issue_links" WHERE "issue_links"."source_id" = 195 AND "issue_links"."target_id" = 197 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
66: SELECT "issue_links".* FROM "issue_links" WHERE "issue_links"."source_id" = 197 AND "issue_links"."target_id" = 195 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/issuable_link.rb:55:in `check_opposite_relation'*/
67: SELECT 1 AS one FROM "work_item_parent_links" WHERE "work_item_parent_links"."work_item_parent_id" IN (195, 197) AND "work_item_parent_links"."work_item_id" IN (195, 197) LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/linkable_item.rb:29:in `check_existing_parent_link'*/
68: INSERT INTO "issue_links" ("source_id", "target_id", "created_at", "updated_at") VALUES (195, 197, '2023-08-10 17:10:59.932398', '2023-08-10 17:10:59.932398') RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
69: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
70: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/issue.rb:490:in `to_reference'*/
71: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
72: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."project_id" = 54 AND "issues"."iid" = 3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
73: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
74: SELECT "work_item_types".* FROM "work_item_types" WHERE "work_item_types"."id" = 281 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
75: 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 ('marked this work item as related to #3', 'Issue', 99, '2023-08-10 17:10:59.939380', '2023-08-10 17:10:59.939957', 54, 195, TRUE, '92af4c55bdd973cfa06864f5d3b819c5d409d332', '<p data-sourcepos="1:1-1:38" dir="auto">marked this work item as related to <a href="/namespace1/project-1/-/issues/3" data-reference-type="issue" data-original="#3" data-link="false" data-link-reference="false" data-project="54" data-issue="197" data-project-path="namespace1/project-1" data-iid="3" data-issue-type="issue" data-container="body" data-placement="top" title="My title 3" class="gfm gfm-issue">#3</a></p>', 2097152) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
76: INSERT INTO "system_note_metadata" ("action", "created_at", "updated_at", "note_id") VALUES ('relate', '2023-08-10 17:10:59.953143', '2023-08-10 17:10:59.953143', 149) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
77: DELETE FROM "issue_user_mentions" WHERE "issue_user_mentions"."issue_id" = 195 AND "issue_user_mentions"."note_id" = 149 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/cache_markdown_field.rb:182:in `store_mentions!'*/
78: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
79: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 153 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb:220:in `get_params_from_container'*/
80: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
81: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 54 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
82: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."project_id" = 54 AND "issues"."iid" = 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
83: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
84: SELECT "work_item_types".* FROM "work_item_types" WHERE "work_item_types"."id" = 281 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
85: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 153 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/inline_observability_filter.rb:55:in `group'*/
86: 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 ('marked this work item as related to #1', 'Issue', 99, '2023-08-10 17:10:59.962759', '2023-08-10 17:10:59.963449', 54, 197, TRUE, 'ef34fc375161f87594f41162107c65079e635c78', '<p data-sourcepos="1:1-1:38" dir="auto">marked this work item as related to <a href="/namespace1/project-1/-/issues/1" data-reference-type="issue" data-original="#1" data-link="false" data-link-reference="false" data-project="54" data-issue="195" data-project-path="namespace1/project-1" data-iid="1" data-issue-type="issue" data-container="body" data-placement="top" title="My title 1" class="gfm gfm-issue">#1</a></p>', 2097152) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
87: INSERT INTO "system_note_metadata" ("action", "created_at", "updated_at", "note_id") VALUES ('relate', '2023-08-10 17:10:59.979080', '2023-08-10 17:10:59.979080', 150) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
88: DELETE FROM "issue_user_mentions" WHERE "issue_user_mentions"."issue_id" = 197 AND "issue_user_mentions"."note_id" = 150 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/cache_markdown_field.rb:182:in `store_mentions!'*/
89: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
90: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 153 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
91: SELECT 1 AS one FROM "issue_links" WHERE "issue_links"."source_id" = 195 AND "issue_links"."id" != 145 AND "issue_links"."target_id" = 197 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:79:in `block in link_issuables'*/
92: SELECT "issue_links".* FROM "issue_links" WHERE "issue_links"."source_id" = 197 AND "issue_links"."target_id" = 195 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/issuable_link.rb:55:in `check_opposite_relation'*/
93: SELECT 1 AS one FROM "work_item_parent_links" WHERE "work_item_parent_links"."work_item_parent_id" IN (195, 197) AND "work_item_parent_links"."work_item_id" IN (195, 197) LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/linkable_item.rb:29:in `check_existing_parent_link'*/
94: SELECT "issue_links".* FROM "issue_links" WHERE "issue_links"."source_id" = 195 AND "issue_links"."target_id" = 198 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:43:in `relate_issuables'*/
95: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
96: SELECT 1 AS one FROM "issue_links" WHERE "issue_links"."source_id" = 195 AND "issue_links"."target_id" = 198 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
97: SELECT "issue_links".* FROM "issue_links" WHERE "issue_links"."source_id" = 198 AND "issue_links"."target_id" = 195 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/issuable_link.rb:55:in `check_opposite_relation'*/
98: SELECT 1 AS one FROM "work_item_parent_links" WHERE "work_item_parent_links"."work_item_parent_id" IN (195, 198) AND "work_item_parent_links"."work_item_id" IN (195, 198) LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/linkable_item.rb:29:in `check_existing_parent_link'*/
99: INSERT INTO "issue_links" ("source_id", "target_id", "created_at", "updated_at") VALUES (195, 198, '2023-08-10 17:10:59.996869', '2023-08-10 17:10:59.996869') RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
100: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:47:in `relate_issuables'*/
101: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/issue.rb:490:in `to_reference'*/
102: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
103: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."project_id" = 54 AND "issues"."iid" = 4 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
104: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
105: SELECT "work_item_types".* FROM "work_item_types" WHERE "work_item_types"."id" = 281 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
106: 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 ('marked this work item as related to #4', 'Issue', 99, '2023-08-10 17:11:00.002470', '2023-08-10 17:11:00.003049', 54, 195, TRUE, '3c3f443a836a939669c92427a9d739b8be2b65c3', '<p data-sourcepos="1:1-1:38" dir="auto">marked this work item as related to <a href="/namespace1/project-1/-/issues/4" data-reference-type="issue" data-original="#4" data-link="false" data-link-reference="false" data-project="54" data-issue="198" data-project-path="namespace1/project-1" data-iid="4" data-issue-type="issue" data-container="body" data-placement="top" title="My title 4" class="gfm gfm-issue">#4</a></p>', 2097152) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
107: INSERT INTO "system_note_metadata" ("action", "created_at", "updated_at", "note_id") VALUES ('relate', '2023-08-10 17:11:00.017908', '2023-08-10 17:11:00.017908', 151) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
108: DELETE FROM "issue_user_mentions" WHERE "issue_user_mentions"."issue_id" = 195 AND "issue_user_mentions"."note_id" = 151 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/cache_markdown_field.rb:182:in `store_mentions!'*/
109: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
110: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 153 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb:220:in `get_params_from_container'*/
111: SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
112: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 54 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
113: SELECT "issues"."id", "issues"."title", "issues"."author_id", "issues"."project_id", "issues"."created_at", "issues"."updated_at", "issues"."description", "issues"."milestone_id", "issues"."iid", "issues"."updated_by_id", "issues"."weight", "issues"."confidential", "issues"."due_date", "issues"."moved_to_id", "issues"."lock_version", "issues"."title_html", "issues"."description_html", "issues"."time_estimate", "issues"."relative_position", "issues"."service_desk_reply_to", "issues"."cached_markdown_version", "issues"."last_edited_at", "issues"."last_edited_by_id", "issues"."discussion_locked", "issues"."closed_at", "issues"."closed_by_id", "issues"."state_id", "issues"."duplicated_to_id", "issues"."promoted_to_epic_id", "issues"."health_status", "issues"."external_key", "issues"."sprint_id", "issues"."blocking_issues_count", "issues"."upvotes_count", "issues"."work_item_type_id", "issues"."namespace_id", "issues"."start_date" FROM "issues" WHERE "issues"."project_id" = 54 AND "issues"."iid" = 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
114: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 154 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
115: SELECT "work_item_types".* FROM "work_item_types" WHERE "work_item_types"."id" = 281 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/references/reference_cache.rb:94:in `block in load_records_per_parent'*/
116: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 153 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/lib/banzai/filter/inline_observability_filter.rb:55:in `group'*/
117: 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 ('marked this work item as related to #1', 'Issue', 99, '2023-08-10 17:11:00.028578', '2023-08-10 17:11:00.029146', 54, 198, TRUE, '42012706d402a03ba90ee23c623ec2fe40e3ffac', '<p data-sourcepos="1:1-1:38" dir="auto">marked this work item as related to <a href="/namespace1/project-1/-/issues/1" data-reference-type="issue" data-original="#1" data-link="false" data-link-reference="false" data-project="54" data-issue="195" data-project-path="namespace1/project-1" data-iid="1" data-issue-type="issue" data-container="body" data-placement="top" title="My title 1" class="gfm gfm-issue">#1</a></p>', 2097152) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
118: INSERT INTO "system_note_metadata" ("action", "created_at", "updated_at", "note_id") VALUES ('relate', '2023-08-10 17:11:00.046666', '2023-08-10 17:11:00.046666', 152) RETURNING "id" /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
119: DELETE FROM "issue_user_mentions" WHERE "issue_user_mentions"."issue_id" = 198 AND "issue_user_mentions"."note_id" = 152 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/cache_markdown_field.rb:182:in `store_mentions!'*/
120: RELEASE SAVEPOINT active_record_3 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/system_notes/base_service.rb:19:in `create_note'*/
121: SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 153 AND "routes"."source_type" = 'Namespace' LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/routable.rb:153:in `full_attribute'*/
122: SELECT 1 AS one FROM "issue_links" WHERE "issue_links"."source_id" = 195 AND "issue_links"."id" != 146 AND "issue_links"."target_id" = 198 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/services/issuable_links/create_service.rb:79:in `block in link_issuables'*/
123: SELECT "issue_links".* FROM "issue_links" WHERE "issue_links"."source_id" = 198 AND "issue_links"."target_id" = 195 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/issuable_link.rb:55:in `check_opposite_relation'*/
124: SELECT 1 AS one FROM "work_item_parent_links" WHERE "work_item_parent_links"."work_item_parent_id" IN (195, 198) AND "work_item_parent_links"."work_item_id" IN (195, 198) LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/concerns/linkable_item.rb:29:in `check_existing_parent_link'*/
125: SELECT "work_item_types".* FROM "work_item_types" WHERE "work_item_types"."id" = 281 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/ee/app/models/ee/work_item.rb:27:in `block in widgets'*/
126: SELECT "work_item_widget_definitions".* FROM "work_item_widget_definitions" WHERE "work_item_widget_definitions"."work_item_type_id" = 281 AND "work_item_widget_definitions"."disabled" = FALSE /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/work_items/type.rb:92:in `filter_map'*/
127: SELECT issues.*, issue_links.id AS issue_link_id, issue_links.link_type as issue_link_type_value, issue_links.target_id as issue_link_source_id, issue_links.created_at as issue_link_created_at, issue_links.updated_at as issue_link_updated_at FROM "issues" INNER JOIN issue_links ON
(issue_links.source_id = issues.id AND issue_links.target_id = 195)
OR
(issue_links.target_id = issues.id AND issue_links.source_id = 195) ORDER BY issue_link_id /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/ability.rb:46:in `block in issues_readable_by_user'*/
128: SELECT "projects"."id", "projects"."name", "projects"."path", "projects"."description", "projects"."created_at", "projects"."updated_at", "projects"."creator_id", "projects"."namespace_id", "projects"."last_activity_at", "projects"."import_url", "projects"."visibility_level", "projects"."archived", "projects"."avatar", "projects"."merge_requests_template", "projects"."star_count", "projects"."merge_requests_rebase_enabled", "projects"."import_type", "projects"."import_source", "projects"."approvals_before_merge", "projects"."reset_approvals_on_push", "projects"."merge_requests_ff_only_enabled", "projects"."issues_template", "projects"."mirror", "projects"."mirror_last_update_at", "projects"."mirror_last_successful_update_at", "projects"."mirror_user_id", "projects"."shared_runners_enabled", "projects"."runners_token", "projects"."build_allow_git_fetch", "projects"."build_timeout", "projects"."mirror_trigger_builds", "projects"."pending_delete", "projects"."public_builds", "projects"."last_repository_check_failed", "projects"."last_repository_check_at", "projects"."only_allow_merge_if_pipeline_succeeds", "projects"."has_external_issue_tracker", "projects"."repository_storage", "projects"."repository_read_only", "projects"."request_access_enabled", "projects"."has_external_wiki", "projects"."ci_config_path", "projects"."lfs_enabled", "projects"."description_html", "projects"."only_allow_merge_if_all_discussions_are_resolved", "projects"."repository_size_limit", "projects"."printing_merge_request_link_enabled", "projects"."auto_cancel_pending_pipelines", "projects"."service_desk_enabled", "projects"."cached_markdown_version", "projects"."delete_error", "projects"."last_repository_updated_at", "projects"."disable_overriding_approvers_per_merge_request", "projects"."storage_version", "projects"."resolve_outdated_diff_discussions", "projects"."remote_mirror_available_overridden", "projects"."only_mirror_protected_branches", "projects"."pull_mirror_available_overridden", "projects"."jobs_cache_index", "projects"."external_authorization_classification_label", "projects"."mirror_overwrites_diverged_branches", "projects"."pages_https_only", "projects"."external_webhook_token", "projects"."packages_enabled", "projects"."merge_requests_author_approval", "projects"."pool_repository_id", "projects"."runners_token_encrypted", "projects"."bfg_object_map", "projects"."detected_repository_languages", "projects"."merge_requests_disable_committers_approval", "projects"."require_password_to_approve", "projects"."max_pages_size", "projects"."max_artifacts_size", "projects"."pull_mirror_branch_prefix", "projects"."remove_source_branch_after_merge", "projects"."marked_for_deletion_at", "projects"."marked_for_deletion_by_user_id", "projects"."autoclose_referenced_issues", "projects"."suggestion_commit_message", "projects"."project_namespace_id", "projects"."hidden" FROM "projects" WHERE "projects"."id" = 54 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/ability.rb:46:in `block in issues_readable_by_user'*/
129: SELECT "project_features".* FROM "project_features" WHERE "project_features"."project_id" = 54 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/ability.rb:46:in `block in issues_readable_by_user'*/
130: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 153 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/ability.rb:46:in `block in issues_readable_by_user'*/
131: SELECT "users".* FROM "users" INNER JOIN "project_authorizations" ON "users"."id" = "project_authorizations"."user_id" WHERE "project_authorizations"."project_id" = 54 AND "project_authorizations"."access_level" = 50 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/project_team.rb:112:in `owners'*/
132: SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = 153 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/project.rb:1822:in `owner'*/
133: SELECT "users".* FROM "users" WHERE "users"."id" = 98 LIMIT 1 /*application:test,correlation_id:1d84396b-3855-44d4-b884-d86689bdacec,endpoint_id:graphql:unknown,db_config_name:main,line:/app/models/project.rb:1822:in `owner'*/