Skip to content

Revert "Merge branch '373285-fix-n-1-queries-for-epic-label_links' into 'master'"

Eugenia Grieff requested to merge revert-b6dea42f into master

What does this MR do and why?

With !97705 (merged) we preloaded label_links association for labels when querying epics. The resulting query can be very slow if there is a large number of labels resulting in degraded performance.

Query plan (internal)

Screenshot_2022-09-20_at_16.57.58

The previous N+1 queries were:

SELECT "labels".* FROM "labels" INNER JOIN "label_ links" ON "labels"."id" = "label links"."label
_id" WHERE "label _links"."target_id" = 374092 AND "label_links"."target _type" = 'Epic' ORDER BY "labels". "title" ASC, "labels"."id" DESC LIMIT 100

MR acceptance checklist

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

Edited by Eugenia Grieff

Merge request reports