summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Adjusted ips/sec for find_by_any_email benchmarksoptimize-user-find-by-any-emailYorick Peterse2015-10-301-2/+2
| | | | | | While these benchmarks run at roughly 1500 i/sec setting the threshold to 1000 leaves some room for deviations (e.g. due to different DB setups).
* Use a subquery with IDs only for find_by_any_emailYorick Peterse2015-10-301-9/+7
| | | | | | | This further improves performance of User.find_by_any_email and is roughly twice as fast as the previous UNION setup. Thanks again to @dlemstra for suggesting this.
* Fixed UNION syntax for MySQLYorick Peterse2015-10-301-2/+2
| | | | MySQL doesn't support the previous syntax.
* Use a UNION for User.find_by_any_emailYorick Peterse2015-10-301-3/+12
| | | | | | | | | | This is significantly faster than using a sub-query, at least when run on the GitLab.com production database. The benchmarks are a lot slower now with these changes, most likely due to PostgreSQL choosing a different (and less efficient) plan based on the amount of data present in the test database. Thanks to @dlemstra for suggesting the use of a UNION.
* Changelog entry for User.find_by_any_emailYorick Peterse2015-10-301-0/+1
|
* Improve performance of User.find_by_any_emailYorick Peterse2015-10-302-15/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This query used to rely on a JOIN, effectively producing the following SQL: SELECT users.* FROM users LEFT OUTER JOIN emails ON emails.user_id = users.id WHERE (users.email = X OR emails.email = X) LIMIT 1; The use of a JOIN means having to scan over all Emails and users, join them together and then filter out the rows that don't match the criteria (though this step may be taken into account already when joining). In the new setup this query instead uses a sub-query, producing the following SQL: SELECT * FROM users WHERE id IN (select user_id FROM emails WHERE email = X) OR email = X LIMIT 1; This query has the benefit that it: 1. Doesn't have to JOIN any rows 2. Only has to operate on a relatively small set of rows from the "emails" table. Since most users will only have a handful of Emails associated (certainly not hundreds or even thousands) the size of the set returned by the sub-query is small enough that it should not become problematic. Performance of the old versus new version can be measured using the following benchmark: # Save this in ./bench.rb require 'benchmark/ips' email = 'yorick@gitlab.com' def User.find_by_any_email_old(email) user_table = arel_table email_table = Email.arel_table query = user_table. project(user_table[Arel.star]). join(email_table, Arel::Nodes::OuterJoin). on(user_table[:id].eq(email_table[:user_id])). where(user_table[:email].eq(email).or(email_table[:email].eq(email))) find_by_sql(query.to_sql).first end Benchmark.ips do |bench| bench.report 'original' do User.find_by_any_email_old(email) end bench.report 'optimized' do User.find_by_any_email(email) end bench.compare! end Running this locally using "bundle exec rails r bench.rb" produces the following output: Calculating ------------------------------------- original 1.000 i/100ms optimized 93.000 i/100ms ------------------------------------------------- original 11.103 (± 0.0%) i/s - 56.000 optimized 948.713 (± 5.3%) i/s - 4.743k Comparison: optimized: 948.7 i/s original: 11.1 i/s - 85.45x slower In other words, the new setup is 85x faster compared to the old setup, at least when running this benchmark locally. For GitLab.com these improvements result in User.find_by_any_email taking only ~170 ms to run, instead of around 800 ms. While this is "only" an improvement of about 4.5 times (instead of 85x) it's still significantly better than before. Fixes #3242
* Merge branch 'binford2k/gitlab-ce-feature/create_new_directories'Douwe Maan2015-10-298-5/+66
|\
| * Update changelog itemDouwe Maan2015-10-291-3/+3
| |
| * Add ability to create directories in the editorBen Ford2015-10-298-5/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | Simply type a name with a `/` directory separator and new directories will be created. This does not do the fancy UI work that github.com does, but it will get the job done. I could not find tests for file creation, so I didn't add a test for this slight behaviour modification. I did test directory traversals though, using both absolute paths like `/tmp/foo.txt` and relative paths like `../../foo.txt`. Neither case escaped the repository, though attempting to traverse with a relative path resulted in a 500 error that did not affect application stability upon reload.
* | Merge branch 'fix-issue-3138' into 'master' Douwe Maan2015-10-292-1/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Force update refs/merge-requests/X/head upon a push to the source branch of a merge request If a user rebases and does a force push, GitLab would not update the `refs/merge-requests/X/head` link. Using the -f flag forces this to happen. Closes #3138 See merge request !1683
| * | Force update refs/merge-requests/X/head upon a push to the source branch of ↵Stan Hu2015-10-292-1/+2
| | | | | | | | | | | | | | | | | | a merge request Closes #3138
* | | Merge branch 'shared-file-access' into 'master' Dmitriy Zaporozhets2015-10-295-1/+43
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Start putting shared files in "shared" See merge request !1691
| * | Clarify puppiesshared-file-accessJacob Vosmaer2015-10-261-2/+2
| | |
| * | Start putting shared files in "shared"Jacob Vosmaer2015-10-265-1/+43
| | |
* | | Write out internet explorerSytse Sijbrandij2015-10-291-1/+1
| | |
* | | IE message doesn't need a headingSytse Sijbrandij2015-10-291-5/+1
| |/ |/|
* | Merge branch 'closing-issue-tracker' into 'master' Dmitriy Zaporozhets2015-10-281-0/+7
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Add copy paste text for closing down the Github issue tracker @sytses I think we talked about closing down the Issue tracker on Github. A first step can be closing all the older issues and steering people towards the gitlab.com issue tracker. What do you think about this text? See merge request !1689
| * | Add copy paste text for closing down the Github issue trackerclosing-issue-trackerJeroen van Baarsen2015-10-281-0/+7
| | | | | | | | | | | | Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* | | Merge branch 'edit-new-cross-references' into 'master' Dmitriy Zaporozhets2015-10-280-0/+0
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Use issue editor as cross reference comment author when issue is edited with a new mention. Fixes #3244. See merge request !1696
* \ \ \ Merge branch 'rs-update-nprogress-rails' into 'master' Dmitriy Zaporozhets2015-10-282-3/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump nprogress-rails to 0.1.6.7 Closes #2866 See merge request !1686
| * | | | Bump nprogress-rails to 0.1.6.7rs-update-nprogress-railsRobert Speicher2015-10-262-3/+3
| | | | | | | | | | | | | | | | | | | | Closes #2866
* | | | | Merge branch 'edit-new-cross-references'Dmitriy Zaporozhets2015-10-284-3/+4
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Use issue editor as cross reference comment author when issue is edited with ↵edit-new-cross-referencesDouwe Maan2015-10-284-3/+4
| | | | | | | | | | | | | | | | | | | | a new mention.
* | | | | Merge branch 'cleanup-ci-integration' into 'master' Dmitriy Zaporozhets2015-10-288-83/+1
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove deprecated CI events from project settings page Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> cc @ayufan Part of #2594 See merge request !1694
| * | | | | Remove deprecated CI events from project settings pageDmitriy Zaporozhets2015-10-288-83/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* | | | | | Merge branch 'fix_permission_doc' into 'master' Achilleas Pipinellis2015-10-281-2/+2
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the permission doc The guest users was missing "Pull project code" and "Download project". /cc @axil See merge request !1695
| * | | | | Fixed the permission docHannes Rosenögger2015-10-281-2/+2
| | |/ / / | |/| | | | | | | | | | | | | The guest users was missing "Pull project code" and "Download project".
* | | | | Merge branch 'gitlab-shell-v2.6.6' into 'master' Dmitriy Zaporozhets2015-10-282-2/+2
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | Bump gitlab-shell to v2.6.6 See merge request !1673
| * | | | Bump gitlab-shell to v2.6.6Artem V. Navrotskiy2015-10-222-2/+2
| | | | |
* | | | | Merge branch 'rs-update-jquery-atwho-rails' into 'master' Dmitriy Zaporozhets2015-10-272-3/+3
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump jquery-atwho-rails to ~> 1.3.2 Closes #2858 See merge request !1687
| * | | | | Bump jquery-atwho-rails to ~> 1.3.2rs-update-jquery-atwho-railsRobert Speicher2015-10-262-3/+3
| | |/ / / | |/| | | | | | | | | | | | | Closes #2858
* | | | | Merge branch 'add-project-path-index' into 'master' Robert Speicher2015-10-272-1/+11
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add projects path index Fixes performance regression introduced by !1649 See merge request !1692
| * | | | | Add projects path indexadd-project-path-indexKamil Trzcinski2015-10-262-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | Fixes performance regression introduced by MR1649
* | | | | | Merge branch 'builds_to_backup_doc' into 'master' Kamil Trzciński2015-10-271-1/+1
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add builds to the docs as a valid skip option for backups. See merge request !1666
| * | | | | Add builds to the docs as a valid skip option for backups.builds_to_backup_docMarin Jankovski2015-10-221-1/+1
| | | | | |
* | | | | | Merge pull request #9771 from kazubu/fix_error_destroy_without_refererStan Hu2015-10-262-5/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix: 500 error returned if destroy request without HTTP referer
| * | | | | | modify to use redirect_back_or_default functionkazubu2015-10-261-5/+1
| | | | | | |
| * | | | | | Fix: 500 error returned if destroy request without HTTP refererkazubu2015-10-262-1/+2
| | |/ / / / | |/| | | |
* | | | | | Update CHANGELOG for 8.1.1Robert Speicher2015-10-261-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | Merge branch 'fix-ci-badge' into 'master' Robert Speicher2015-10-264-15/+11
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix CI badge The previous code relied on having on ref stored in commit, however the ref was moved to the build. Fixes #3104 See merge request !1690
| * | | | | | Fix CI badgefix-ci-badgeKamil Trzcinski2015-10-264-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous code relied on having on ref stored in commit, however the ref was moved to the build.
* | | | | | | Merge branch 'fix-specific-runner-visibility' into 'master' Robert Speicher2015-10-264-14/+20
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | Fix visibility of specific runners See merge request !1688
| * | | | | | Fix specific runner visibilityKamil Trzcinski2015-10-264-14/+20
| |/ / / / /
* | | | | | Merge branch 'remove-satellites' into 'master' Robert Speicher2015-10-264-4/+25
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | Add migration to remove the contents of the satellites dir See merge request !1681
| * | | | | Remove the contents of the satellites dirremove-satellitesJacob Vosmaer2015-10-234-4/+25
| | |_|_|/ | |/| | |
* | | | | Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ceStan Hu2015-10-2612-12/+47
|\ \ \ \ \
| * \ \ \ \ Merge branch 'dirceu/gitlab-ce-fix-project-search-with-unmatched-parentheses'Douwe Maan2015-10-253-4/+4
| |\ \ \ \ \
| | * | | | | Fix issue #3055 (project search with unmatched parentheses)dirceu/gitlab-ce-fix-project-search-with-unmatched-parenthesesDirceu Pereira Tiegs2015-10-213-4/+4
| | | | | | |
| * | | | | | Merge branch 'ci-status-mr-index' into 'master' Dmitriy Zaporozhets2015-10-259-8/+43
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ci status for merge requests index page ![ci-mr-index](/uploads/1424564c87ac6ff5fb2c4bc260fbebdf/ci-mr-index.png) See merge request !1682
| | * | | | | | Fix rubocop issuesci-status-mr-indexDmitriy Zaporozhets2015-10-232-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>