<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/gitlab/gitlab-ce.git/app/finders, branch bugfix/upgrade-ruby-parser</title>
<subtitle>gitlab.com: gitlab-org/gitlab-ce.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/'/>
<entry>
<title>Introduce an Events API</title>
<updated>2017-06-06T12:16:41+00:00</updated>
<author>
<name>Mark Fletcher</name>
<email>mark@gitlab.com</email>
</author>
<published>2017-05-29T05:49:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=ad3e180ed3d99494414cb1b367f6b4e40ec28b87'/>
<id>ad3e180ed3d99494414cb1b367f6b4e40ec28b87</id>
<content type='text'>
* Meld the following disparate endpoints:
 * `/projects/:id/events`
 * `/events`
 * `/users/:id/events`
+ Add result filtering to the above endpoints:
 * action
 * target_type
 * before and after dates
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Meld the following disparate endpoints:
 * `/projects/:id/events`
 * `/events`
 * `/users/:id/events`
+ Add result filtering to the above endpoints:
 * action
 * target_type
 * before and after dates
</pre>
</div>
</content>
</entry>
<entry>
<title>Enable the Style/PreferredHashMethods cop</title>
<updated>2017-06-02T17:11:26+00:00</updated>
<author>
<name>Rémy Coutable</name>
<email>remy@rymai.me</email>
</author>
<published>2017-06-02T17:11:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=4cfa5ce4a95379a9ebe08f57b170af4b5ee9a9a5'/>
<id>4cfa5ce4a95379a9ebe08f57b170af4b5ee9a9a5</id>
<content type='text'>
Signed-off-by: Rémy Coutable &lt;remy@rymai.me&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Rémy Coutable &lt;remy@rymai.me&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add :owned param to ProjectFinder</title>
<updated>2017-05-30T20:45:59+00:00</updated>
<author>
<name>Toon Claes</name>
<email>toon@gitlab.com</email>
</author>
<published>2017-05-26T14:31:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=db679788e46d55984a4af71034c6db11aed919e4'/>
<id>db679788e46d55984a4af71034c6db11aed919e4</id>
<content type='text'>
And use it in the API.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
And use it in the API.
</pre>
</div>
</content>
</entry>
<entry>
<title>Make it possible to combine :trending with other params</title>
<updated>2017-05-30T20:45:59+00:00</updated>
<author>
<name>Toon Claes</name>
<email>toon@gitlab.com</email>
</author>
<published>2017-05-26T13:39:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=5654ac877df5b6007606e0e1827d965bdf8e552b'/>
<id>5654ac877df5b6007606e0e1827d965bdf8e552b</id>
<content type='text'>
Now it is possible to combine the :non_public parameter. This might be useful
when a user wants to know the trending projects they are member of.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now it is possible to combine the :non_public parameter. This might be useful
when a user wants to know the trending projects they are member of.
</pre>
</div>
</content>
</entry>
<entry>
<title>UNION of SELECT/WHERE is faster than WHERE on UNION</title>
<updated>2017-05-30T20:45:59+00:00</updated>
<author>
<name>Toon Claes</name>
<email>toon@gitlab.com</email>
</author>
<published>2017-05-24T13:03:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=01c6323d238706bc8d0acb0273552a094c996ca0'/>
<id>01c6323d238706bc8d0acb0273552a094c996ca0</id>
<content type='text'>
Instead of applying WHERE on a UNION, apply the WHERE on each of the seperate
SELECT statements, and do UNION on that.

Local tests with about 2_000_000 projects:
 - 1_500_000 private projects
 -    40_000 internal projects
 -   400_000 public projects

For the API endpoint `/api/v4/projects?visibility=private` the slowest query was:

```sql
SELECT "projects".*
FROM "projects"
WHERE ...
```

The original query took 1073.8ms.
The query refactored to UNION of SELECT/WHERE took 2.3ms.

The original query was:

```sql
SELECT "projects".*
FROM "projects"
WHERE "projects"."pending_delete" = $1
  AND (projects.id IN
         (SELECT "projects"."id"
          FROM "projects"
          INNER JOIN "project_authorizations" ON "projects"."id" = "project_authorizations"."project_id"
          WHERE "projects"."pending_delete" = 'f'
            AND "project_authorizations"."user_id" = 23
          UNION SELECT "projects"."id"
          FROM "projects"
          WHERE "projects"."visibility_level" IN (20,
                                                  10)))
  AND "projects"."visibility_level" = $2
  AND "projects"."archived" = $3
ORDER BY "projects"."created_at" DESC
LIMIT 20
OFFSET 0 [["pending_delete", "f"],
       ["visibility_level", 0],
       ["archived", "f"]]
```

The refactored query:
```sql
SELECT "projects".*
FROM "projects"
WHERE "projects"."pending_delete" = $1
  AND (projects.id IN
         (SELECT "projects"."id"
          FROM "projects"
          INNER JOIN "project_authorizations" ON "projects"."id" = "project_authorizations"."project_id"
          WHERE "projects"."pending_delete" = 'f'
            AND "project_authorizations"."user_id" = 23
            AND "projects"."visibility_level" = 0
            AND "projects"."archived" = 'f'
          UNION SELECT "projects"."id"
          FROM "projects"
          WHERE "projects"."visibility_level" IN (20,
                                                  10)
            AND "projects"."visibility_level" = 0
            AND "projects"."archived" = 'f'))
ORDER BY "projects"."created_at" DESC
LIMIT 20
OFFSET 0 [["pending_delete", "f"]]
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of applying WHERE on a UNION, apply the WHERE on each of the seperate
SELECT statements, and do UNION on that.

Local tests with about 2_000_000 projects:
 - 1_500_000 private projects
 -    40_000 internal projects
 -   400_000 public projects

For the API endpoint `/api/v4/projects?visibility=private` the slowest query was:

```sql
SELECT "projects".*
FROM "projects"
WHERE ...
```

The original query took 1073.8ms.
The query refactored to UNION of SELECT/WHERE took 2.3ms.

The original query was:

```sql
SELECT "projects".*
FROM "projects"
WHERE "projects"."pending_delete" = $1
  AND (projects.id IN
         (SELECT "projects"."id"
          FROM "projects"
          INNER JOIN "project_authorizations" ON "projects"."id" = "project_authorizations"."project_id"
          WHERE "projects"."pending_delete" = 'f'
            AND "project_authorizations"."user_id" = 23
          UNION SELECT "projects"."id"
          FROM "projects"
          WHERE "projects"."visibility_level" IN (20,
                                                  10)))
  AND "projects"."visibility_level" = $2
  AND "projects"."archived" = $3
ORDER BY "projects"."created_at" DESC
LIMIT 20
OFFSET 0 [["pending_delete", "f"],
       ["visibility_level", 0],
       ["archived", "f"]]
```

The refactored query:
```sql
SELECT "projects".*
FROM "projects"
WHERE "projects"."pending_delete" = $1
  AND (projects.id IN
         (SELECT "projects"."id"
          FROM "projects"
          INNER JOIN "project_authorizations" ON "projects"."id" = "project_authorizations"."project_id"
          WHERE "projects"."pending_delete" = 'f'
            AND "project_authorizations"."user_id" = 23
            AND "projects"."visibility_level" = 0
            AND "projects"."archived" = 'f'
          UNION SELECT "projects"."id"
          FROM "projects"
          WHERE "projects"."visibility_level" IN (20,
                                                  10)
            AND "projects"."visibility_level" = 0
            AND "projects"."archived" = 'f'))
ORDER BY "projects"."created_at" DESC
LIMIT 20
OFFSET 0 [["pending_delete", "f"]]
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Change ProjectFinder so starred can be combined with other filters</title>
<updated>2017-05-30T20:45:59+00:00</updated>
<author>
<name>Toon Claes</name>
<email>toon@gitlab.com</email>
</author>
<published>2017-05-23T20:38:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=0725050802dd30d4c235b6a2d28dd494d2d7429b'/>
<id>0725050802dd30d4c235b6a2d28dd494d2d7429b</id>
<content type='text'>
The `starred` parameter couldn't be used in combination with `trending` or
`non_public`. But this is changed now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The `starred` parameter couldn't be used in combination with `trending` or
`non_public`. But this is changed now.
</pre>
</div>
</content>
</entry>
<entry>
<title>Create a Users Finder</title>
<updated>2017-05-15T13:53:12+00:00</updated>
<author>
<name>George Andrinopoulos</name>
<email>geoandri@gmail.com</email>
</author>
<published>2017-05-15T13:53:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=872e7b7efe923192d4ef90b01672038518ba66fc'/>
<id>872e7b7efe923192d4ef90b01672038518ba66fc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'tc-fix-private-subgroups-shown' into 'security'</title>
<updated>2017-05-10T14:48:18+00:00</updated>
<author>
<name>Douwe Maan</name>
<email>douwe@gitlab.com</email>
</author>
<published>2017-05-03T23:51:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=ea4eb460479a24fea9ee890c8ba8f6f4dec7f44b'/>
<id>ea4eb460479a24fea9ee890c8ba8f6f4dec7f44b</id>
<content type='text'>

Use GroupsFinder to find subgroups the user has access to

See merge request !2096</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>

Use GroupsFinder to find subgroups the user has access to

See merge request !2096</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'snippets-finder-visibility' into 'security'</title>
<updated>2017-05-10T14:48:18+00:00</updated>
<author>
<name>Douwe Maan</name>
<email>douwe@gitlab.com</email>
</author>
<published>2017-04-28T22:06:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=ad309f5d110ebf8859b2e7196c7a1d0b039c0d7c'/>
<id>ad309f5d110ebf8859b2e7196c7a1d0b039c0d7c</id>
<content type='text'>
Refactor snippets finder &amp; dont return internal snippets for external users

See merge request !2094
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactor snippets finder &amp; dont return internal snippets for external users

See merge request !2094
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Pipeline Schedules that supersedes experimental Trigger Schedule</title>
<updated>2017-05-07T22:35:56+00:00</updated>
<author>
<name>Zeger-Jan van de Weg</name>
<email>zegerjan@gitlab.com</email>
</author>
<published>2017-05-07T22:35:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/gitlab/gitlab-ce.git/commit/?id=8df3997a92bffa2d29f3c559933a336b837cdb93'/>
<id>8df3997a92bffa2d29f3c559933a336b837cdb93</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
