An error occurred fetching the project authors.
  1. 20 Nov, 2015 1 commit
  2. 19 Nov, 2015 1 commit
    • Yorick Peterse's avatar
      Use a JOIN in IssuableFinder#by_project · 8591cc02
      Yorick Peterse authored
      When using IssuableFinder/IssuesFinder to find issues for multiple
      projects it's more efficient to use a JOIN + a "WHERE project_id IN"
      condition opposed to running a sub-query.
      
      This change means that when finding issues without labels we're now
      using the following SQL:
      
          SELECT issues.*
          FROM issues
          JOIN projects ON projects.id = issues.project_id
      
          LEFT JOIN label_links ON label_links.target_type = 'Issue'
                                AND label_links.target_id  = issues.id
      
          WHERE (
              projects.id IN (...)
              OR projects.visibility_level IN (20, 10)
          )
          AND issues.state IN ('opened','reopened')
          AND label_links.id IS NULL
          ORDER BY issues.id DESC;
      
      instead of:
      
          SELECT issues.*
          FROM issues
          LEFT JOIN label_links ON label_links.target_type = 'Issue'
                                AND label_links.target_id  = issues.id
      
          WHERE issues.project_id IN (
              SELECT id
              FROM projects
              WHERE id IN (...)
              OR visibility_level IN (20,10)
          )
          AND issues.state IN ('opened','reopened')
          AND label_links.id IS NULL
          ORDER BY issues.id DESC;
      
      The big benefit here is that in the last case PostgreSQL can't properly
      use all available indexes. In particular it ends up performing a
      sequence scan on the "label_links" table (processing around 290 000
      rows). The new query is roughly 2x as fast as the old query.
      8591cc02
  3. 18 Nov, 2015 1 commit
  4. 11 Nov, 2015 1 commit
    • Yorick Peterse's avatar
      Change "recent" scopes to sort by "id" · 7eb502c0
      Yorick Peterse authored
      These scopes can just sort by the "id" column in descending order to
      achieve the same result. An added benefit is being able to perform a
      backwards index scan (depending on the rest of the final query) instead
      of having to actually sort data.
      7eb502c0
  5. 16 Oct, 2015 1 commit
  6. 15 Oct, 2015 1 commit
  7. 14 Oct, 2015 1 commit
  8. 16 Sep, 2015 1 commit
  9. 30 Jul, 2015 1 commit
  10. 24 Jul, 2015 1 commit
  11. 24 Apr, 2015 1 commit
  12. 17 Apr, 2015 1 commit
  13. 15 Apr, 2015 1 commit
  14. 02 Apr, 2015 1 commit
  15. 16 Mar, 2015 3 commits
  16. 15 Mar, 2015 1 commit
  17. 06 Feb, 2015 2 commits
  18. 22 Jan, 2015 1 commit
  19. 19 Jan, 2015 1 commit
  20. 05 Oct, 2014 1 commit
  21. 02 Oct, 2014 1 commit
  22. 27 Aug, 2014 1 commit
  23. 20 Aug, 2014 1 commit
  24. 14 Aug, 2014 1 commit
  25. 30 Jul, 2014 1 commit
  26. 29 Jul, 2014 1 commit
  27. 04 Jun, 2014 1 commit
  28. 03 Jun, 2014 1 commit
  29. 25 Mar, 2014 1 commit
  30. 28 Feb, 2014 1 commit
  31. 10 Feb, 2014 1 commit
  32. 14 Jan, 2014 1 commit
  33. 04 Dec, 2013 1 commit
  34. 09 Sep, 2013 1 commit
  35. 21 Aug, 2013 1 commit
  36. 19 Aug, 2013 2 commits