Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-3738

Improve performance of filters without criteria

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Component/s: Measures
    • Labels:
      None

      Description

      The condition on the sorting measure is missing in the inner join :

      SELECT s.id, MAX(s.project_id) as pid, MAX(s.root_project_id) as rpid, MAX(CASE WHEN pm.metric_id=129 THEN text_value ELSE NULL END) AS sortvalue
      FROM snapshots s
      INNER JOIN project_measures pm ON s.id=pm.snapshot_id
      INNER JOIN projects p ON s.project_id=p.id
      WHERE pm.rule_id IS NULL AND pm.rule_priority IS NULL AND pm.characteristic_id IS NULL AND pm.person_id IS NULL AND s.status=? AND s.islast=? AND s.qualifier IN ('xxx') AND p.copy_resource_id IS NULL
      GROUP BY s.id

      The following should be added to WHERE :

      AND pm.metric_id=129

        Attachments

          Activity

            People

            Assignee:
            simon.brandhof Simon Brandhof (Inactive)
            Reporter:
            simon.brandhof Simon Brandhof (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: