Add index on vulnerability_feedback (finding_uuid)

Why are we doing this work

The following discussion from !82143 (merged) should be addressed:

  • @dfrazao-gitlab started a discussion: (+4 comments)

    query: load_feedback

    I can see two red flags in this query/query+plan. We are using a sequential scan and the uuid data type is different. vulnerability_occurrences uses varchar vulnerability_feedback uses uuid.

Relevant links

Non-functional requirements

  • Performance: Show query timing

Implementation plan

  • database Add index to vulnerability_feedback.finding_uuid

Verification steps

  1. Run the following query plan:
SELECT
    *
FROM
    vulnerability_feedback
WHERE
    finding_uuid = (
        SELECT
            finding_uuid
        FROM
            vulnerability_feedback
        LIMIT 1)
  1. There should be an index call in the plan

Current plan with no index

Edited by Jonathan Schafer