1. 19 Nov, 2015 13 commits
    • Yorick Peterse's avatar
      Align hash literals in IssuesFinder spec · 094e1cc0
      Yorick Peterse authored
      094e1cc0
    • Yorick Peterse's avatar
      901d3dee
    • 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
    • Yorick Peterse's avatar
      Memoize IssuableFinder#projects · e9cd58f5
      Yorick Peterse authored
      Since this method's returned data doesn't change between calls on the
      same IssuableFinder instance we can just memoize this similar to the
      "project" method.
      e9cd58f5
    • Yorick Peterse's avatar
      c232a0f9
    • Yorick Peterse's avatar
      Added benchmark for IssuesFinder · 45840426
      Yorick Peterse authored
      45840426
    • Yorick Peterse's avatar
      e4ae8b13
    • Yorick Peterse's avatar
      Added index on projects.visibility_level · d63da890
      Yorick Peterse authored
      d63da890
    • Yorick Peterse's avatar
      Added index on issues.state · 50f65416
      Yorick Peterse authored
      This field is queried when filtering issues and due to the lack of an
      index would end up triggering a sequence scan.
      50f65416
    • Yorick Peterse's avatar
      Merge branch 'atom-feed-latest-update' into 'master' · a42d469a
      Yorick Peterse authored
      Improve performance of user profiles, finding groups, and finding projects
      
      This MR improves the following:
      
      * Rendering of profile pages and Atom feeds
      * Finding groups (using GroupsFinder & friends)
      * Finding projects (using ProjectsFinder & friends)
      
      Initially this MR was intended to only improve rendering of Atom feeds, but over time other fixes were introduced as well as the same code was the cause of all these problems.
      
      See merge request !1790
      a42d469a
    • Yorick Peterse's avatar
      96cdacd4
    • Dmitriy Zaporozhets's avatar
      Merge branch 'check_if_it_should_be_archived_in_backup' into 'master' · 5b302854
      Dmitriy Zaporozhets authored
      Check which folders and archives should be packed before passing to tar command.
      
      If user uses backup task with SKIP and skips one of the archives listed(uploads, builds, artifacts) backup create will give an error: `Cannot stat: No such file or directory`.
      
      This MR fixes that by checking for skipped items.
      Additionally, compact everything to avoid `TypeError: no implicit conversion of nil into String` errors.
      
      See merge request !1824
      5b302854
    • Kamil Trzcinski's avatar
      Fix CHANGELOG · caf1c9d8
      Kamil Trzcinski authored
      caf1c9d8
  2. 18 Nov, 2015 27 commits