Avoid loading all labels when autocompleting quick action commands

What does this MR do and why?

Use an SQL exists query to check if there are available labels instead of loading all labels into memory.

This is slow for projects / groups with a lot of labels.

References

Related to #595401 (closed)

How to set up and validate locally

  1. Type / in the comment text area of a work item or MR
  2. Check the performance bar queries for the /<group>/<project>/-/autocomplete_sources/commands request
Before After
Screenshot_2026-05-06_at_1.26.54_AM Screenshot_2026-05-06_at_1.25.16_AM

The query should now be an existence query in the format: SELECT 1 as one ... LIMIT 1

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Heinrich Lee Yu

Merge request reports

Loading