Skip to content

Use work_item_type in `without_issue_type` and `with_issue_type` scopes

Mario Celi requested to merge 410212-use-work-item-types into master

What does this MR do and why?

Use work_item_types table in without_issue_type with_issue_type scopes

Join issues with the work_item_types table in both without_issue_type and with_issue_type scopes.

Change behind the issue_type_uses_work_item_types_table feature flag

Database review

.with_issue_type

Before

https://console.postgres.ai/shared/56ebd379-32f0-481f-90d6-1103c5331344 (warm)
SELECT 
  "issues".* 
FROM 
  "issues" 
WHERE 
  "issues"."project_id" = 278964 
  AND "issues"."issue_type" = 0 
ORDER BY 
  "issues"."created_at" DESC, 
  "issues"."id" DESC 
LIMIT 
  101

https://console.postgres.ai/shared/b935608f-7dc7-4bcf-aab2-bab97762a402 (cold)

After

https://console.postgres.ai/shared/d45502af-7f73-40ab-bec8-e888b2b2b4c6 (warm)
SELECT 
  "issues".* 
FROM 
  "issues" 
  INNER JOIN "work_item_types" ON "work_item_types"."id" = "issues"."work_item_type_id" 
WHERE 
  "issues"."project_id" = 278964 
  AND "work_item_types"."base_type" = 0 
ORDER BY 
  "issues"."created_at" DESC, 
  "issues"."id" DESC 
LIMIT 
  101

https://console.postgres.ai/shared/e93a5cc6-a464-4d16-82be-e22bf66fd4c7 (cold)

.without_issue_type

Before

https://console.postgres.ai/shared/926cc5c8-ba12-435e-b086-8837ccae8861 (warm)
SELECT 
  "issues".* 
FROM 
  "issues" 
WHERE 
  "issues"."project_id" = 278964 
  AND "issues"."issue_type" != 4 
ORDER BY 
  "issues"."created_at" DESC, 
  "issues"."id" DESC 
LIMIT 
  101

https://console.postgres.ai/shared/c08e3270-6494-4531-8998-1a408c1c0b4b (cold)

After

https://console.postgres.ai/shared/282e6324-4801-461f-a59c-75875e92946c (warm)
SELECT 
  "issues".* 
FROM 
  "issues" 
  INNER JOIN "work_item_types" ON "work_item_types"."id" = "issues"."work_item_type_id" 
WHERE 
  "issues"."project_id" = 278964 
  AND "work_item_types"."base_type" != 4 
ORDER BY 
  "issues"."created_at" DESC, 
  "issues"."id" DESC 
LIMIT 
  101

https://console.postgres.ai/shared/e9e903cc-8b9a-43b8-a24a-68dffc2dad49 (cold)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #410212 (closed)

Edited by Mario Celi

Merge request reports

Loading