- 13 Sep, 2017 18 commits
-
-
Yorick Peterse authored
-
Yorick Peterse authored
When querying the deployments of an environment the query Rails produces will be along the lines of the following: SELECT * FROM deployments WHERE environment_id = X For queries such as this (or queries that use this as their base and add more conditions) there is no meaningful index that can be used as long as deployments.project_id is not part of a WHERE clause. To work around this we change that "has_many :deployments" relation to always add a "WHERE project_id = X" condition. This means that queries filtering deployments can make better use of the existing indexes. For example, when filtering by deployments.iid this will result in the following query: SELECT * FROM deployments WHERE environment_id = X AND project_id = Y AND iid = Z This means PostgreSQL can use the existing index on (project_id, environment_id, iid) instead of having to use a different index (or none at all) and having to scan over a large amount of data. Query plan wise this means that instead of this query and plan: EXPLAIN (BUFFERS, ANALYZE) SELECT deployments.* FROM deployments WHERE deployments.environment_id = 5 AND deployments.iid = 225; Index Scan using index_deployments_on_project_id_and_iid on deployments (cost=0.42..14465.75 rows=1 width=117) (actual time=6.394..38.048 rows=1 loops=1) Index Cond: (iid = 225) Filter: (environment_id = 5) Rows Removed by Filter: 839 Buffers: shared hit=4534 Planning time: 0.076 ms Execution time: 38.073 ms We produce the following query and plan: EXPLAIN (BUFFERS, ANALYZE) SELECT deployments.* FROM deployments WHERE deployments.environment_id = 5 AND deployments.iid = 225 AND deployments.project_id = 1292351; Index Scan using index_deployments_on_project_id_and_iid on deployments (cost=0.42..4.45 rows=1 width=117) (actual time=0.018..0.018 rows=1 loops=1) Index Cond: ((project_id = 1292351) AND (iid = 225)) Filter: (environment_id = 5) Buffers: shared hit=4 Planning time: 0.088 ms Execution time: 0.039 ms On GitLab.com these changes result in a (roughly) 11x improvement in SQL timings for the CI environment status endpoint. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36877
-
Kamil Trzciński authored
AutoDevOps banner hidden on explicit CI config Closes #37652 See merge request !14207
-
Rémy Coutable authored
Fix: GPG tmp dir removal race condition Ignore any errors when removing the tmp directory, as we may run into a race condition: The `gpg-agent` agent process may clean up some files as well while `FileUtils.remove_entry` is iterating the directory and removing all its contained files and directories recursively, which could raise an error. Closes #36998 See merge request !14194
-
Alexis Reigel authored
-
Rémy Coutable authored
Replace the 'profile/active_tab.feature' spinach test with an rspec analog See merge request !14239
-
Zeger-Jan van de Weg authored
-
Zeger-Jan van de Weg authored
Extends the helper method to no show the banner as soon as the project has a `.gitlab-ci.yml` file on the default branch. Fixes gitlab-org/gitlab-ce#37652
-
Douwe Maan authored
Merge branch '37629-lazy-image-loading-breaks-notification-mails-for-an-added-screenshot' into 'master' Resolve "Lazy image loading breaks notification mails for an added screenshot" Closes #37629 See merge request !14161
-
Douwe Maan authored
Docs for automatically inherit the milestone and labels of the issue See merge request !14223
-
Rémy Coutable authored
Fix the Doorkeeper.optional_scopes issue triggered by !13314 Closes #37753 See merge request !14219
-
Kamil Trzciński authored
-
Kamil Trzciński authored
Allow all AutoDevOps banners to be disabled Closes #37653 See merge request !14218
-
Kamil Trzciński authored
Add usage ping for Auto DevOps Closes #37648 See merge request !14162
-
Rémy Coutable authored
Add help text to runner edit page that tags should be separated by commas. Closes #37405 See merge request !14224
-
Brendan O'Leary authored
-
Grzegorz Bizon authored
Resolve "New issue from failed build no longer links to failed build" Closes #36907 See merge request !13790
-
Grzegorz Bizon authored
Resolve "Move `lib/ci` to `lib/gitlab/ci`" Closes #5836 See merge request !14078
-
- 12 Sep, 2017 22 commits
-
-
Vitaliy @blackst0ne Klachkov authored
-
Stan Hu authored
Remove db/migrate/20170828135939_migrate_user_external_mail_data.rb See merge request !14240
-
Stan Hu authored
Update mysql_to_postgresql.md to deprecate these docs in favor of PGLoader See merge request !14238
-
Stan Hu authored
-
Robert Speicher authored
This file is a duplicate of a post-deploy migration and appears to have been left in by mistake. Looping through the Users table in a foreground migration would've been a bad idea. [ci skip]
-
Clement Ho authored
Resolve "Image onion skin + swipe does not work anymore" Closes #37730 and #37732 See merge request !14215
-
Tim Zallmann authored
-
Lee Matos authored
-
Maxim Rydkin authored
fix CI fix CI
-
Maxim Rydkin authored
-
Maxim Rydkin authored
-
Maxim Rydkin authored
-
Maxim Rydkin authored
-
Maxim Rydkin authored
-
Robert Speicher authored
Revert "Merge branch 'revert-f2421b2b' into 'master'" See merge request !14190
-
Achilleas Pipinellis authored
Fix Auto DevOps quick start guide Closes #37768 See merge request !14230
-
Achilleas Pipinellis authored
-
Robert Speicher authored
Decrease Perceived Complexity threshold to 15 See merge request !14160
-
Maxim Rydkin authored
-
Robert Speicher authored
Decrease Cyclomatic Complexity threshold to 13 See merge request !14152
-
Maxim Rydkin authored
-
Robert Speicher authored
Migrate Git::CommitStats to Gitaly Closes gitaly#519 See merge request !14077
-