- 17 May, 2018 7 commits
-
-
Yorick Peterse authored
When displaying the project pipelines dashboard we display a few tabs for different pipeline states. For every such tab we count the number of pipelines that belong to it. For large projects such as GitLab CE this means having to count over 80 000 rows, which can easily take between 70 and 100 milliseconds per query. To improve this we apply a technique we already use for search results: we limit the number of rows to count. The current limit is 1000, which means that if more than 1000 rows are present for a state we will show "1000+" instead of the exact number. The SQL queries used for this perform much better than a regular COUNT, even when a project has a lot of pipelines. Prior to these changes we would end up running a query like this: SELECT COUNT(*) FROM ci_pipelines WHERE project_id = 13083 AND status IN ('success', 'failed', 'canceled') This would produce a plan along the lines of the following: Aggregate (cost=3147.55..3147.56 rows=1 width=8) (actual time=501.413..501.413 rows=1 loops=1) Buffers: shared hit=17116 read=861 dirtied=2 -> Index Only Scan using index_ci_pipelines_on_project_id_and_ref_and_status_and_id on ci_pipelines (cost=0.56..2984.14 rows=65364 width=0) (actual time=0.095..490.263 rows=80388 loops=1) Index Cond: (project_id = 13083) Filter: ((status)::text = ANY ('{success,failed,canceled}'::text[])) Rows Removed by Filter: 2894 Heap Fetches: 353 Buffers: shared hit=17116 read=861 dirtied=2 Planning time: 1.409 ms Execution time: 501.519 ms Using the LIMIT count technique we instead run the following query: SELECT COUNT(*) FROM ( SELECT 1 FROM ci_pipelines WHERE project_id = 13083 AND status IN ('success', 'failed', 'canceled') LIMIT 1001 ) for_count This query produces the following plan: Aggregate (cost=58.77..58.78 rows=1 width=8) (actual time=1.726..1.727 rows=1 loops=1) Buffers: shared hit=169 read=15 -> Limit (cost=0.56..46.25 rows=1001 width=4) (actual time=0.164..1.570 rows=1001 loops=1) Buffers: shared hit=169 read=15 -> Index Only Scan using index_ci_pipelines_on_project_id_and_ref_and_status_and_id on ci_pipelines (cost=0.56..2984.14 rows=65364 width=4) (actual time=0.162..1.426 rows=1001 loops=1) Index Cond: (project_id = 13083) Filter: ((status)::text = ANY ('{success,failed,canceled}'::text[])) Rows Removed by Filter: 9 Heap Fetches: 10 Buffers: shared hit=169 read=15 Planning time: 1.832 ms Execution time: 1.821 ms While this query still uses a Filter for the "status" field the number of rows that it may end up filtering (at most 1001) is small enough that an additional index does not appear to be necessary at this time. See https://gitlab.com/gitlab-org/gitlab-ce/issues/43132#note_68659234 for more information.
-
Douwe Maan authored
Resolve "Opening Project with invite but without accepting leads to 404 error page" Closes #42531 See merge request gitlab-org/gitlab-ce!17634
-
🙈 jacopo beschi 🙉 authored
-
Douwe Maan authored
CE: Add jobs to verify that migrating from CE to EE works See merge request gitlab-org/gitlab-ce!18909
-
Grzegorz Bizon authored
Workhorse to send raw diff and patch for commits Closes gitaly#1196 See merge request gitlab-org/gitlab-ce!18974
-
Phil Hughes authored
Remove unneccessary imports See merge request gitlab-org/gitlab-ce!18993
-
Phil Hughes authored
Add dot to separate system notes content Closes #45676 See merge request gitlab-org/gitlab-ce!18864
-
- 16 May, 2018 33 commits
-
-
Kamil Trzciński authored
Delete remote uploads Closes #45425 See merge request gitlab-org/gitlab-ce!18698
-
Kamil Trzciński authored
API support + Improved policies for group runners Closes #45894 and #38979 See merge request gitlab-org/gitlab-ce!18851
-
Annabel Dunstone Gray authored
-
Mike Greiling authored
Fix contributors graph width Closes #22647 See merge request gitlab-org/gitlab-ce!18639
-
Yorick Peterse authored
Fix Error 500 viewing admin page due to statement timeouts Closes #46255 See merge request gitlab-org/gitlab-ce!18982
-
Clement Ho authored
fixed copy to cliboard button in embedded snippets Closes #46303 See merge request gitlab-org/gitlab-ce!18923
-
haseeb authored
-
Robert Speicher authored
Adjust board lists header text color Closes #36983 See merge request gitlab-org/gitlab-ce!18955
-
Stan Hu authored
Uses PostgreSQL tuple estimates to provide a much faster yet approximate count. See https://wiki.postgresql.org/wiki/Slow_Counting for more details. We only use this fast method if the table has been analyzed or vacuumed within the last hour. Closes #46255
-
Annabel Gray authored
Remove table-section from div holding cluster error messages See merge request gitlab-org/gitlab-ce!18971
-
Rémy Coutable authored
edit GitLab license info in regards to CC licensing See merge request gitlab-org/gitlab-ce!18981
-
Lin Jen-Shin authored
Never drop the database when granting privileges
-
Lin Jen-Shin authored
-
Tim Zallmann authored
Move discussion and notes actions to the right Closes #33645 See merge request gitlab-org/gitlab-ce!18476
-
Nick Thomas authored
Fix GitLab Performance Monitoring content types for Doorkeeper Closes #46412 See merge request gitlab-org/gitlab-ce!18984
-
Filipa Lacerda authored
Project Sidebar: Split CI/CD into CI/CD and Operations Closes #43673 See merge request gitlab-org/gitlab-ce!18941
-
Lukas Eipert authored
-
Douwe Maan authored
Move Gitlab::Git::Repository#add_branch to mandatory Closes gitaly#540 See merge request gitlab-org/gitlab-ce!18939
-
Yorick Peterse authored
Certain controllers (e.g. Doorkeeper::TokensController) don't expose the method "request_format". This commit changes Gitlab::Metrics::WebTransaction so we don't rely on this method, instead using the underlying code this method uses. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/46412
-
Filipa Lacerda authored
Remove docker pull prefix from registry clipboard feature Closes #46314 and #45968 See merge request gitlab-org/gitlab-ce!18933
-
Lars Greiss authored
-
Zeger-Jan van de Weg authored
Prior to this change, this was done through unicorn. In theory this could time out. Workhorse has been sending these raw patches and diffs for a long time and is stable in doing so. Added bonus is the fact that `Commit#to_patch` can be removed. `Commit#to_diff` too, which closes https://gitlab.com/gitlab-org/gitaly/issues/324 Closes https://gitlab.com/gitlab-org/gitaly/issues/1196
-
Dylan Griffith authored
-
Dylan Griffith authored
-
Dylan Griffith authored
-
Dylan Griffith authored
-
Dylan Griffith authored
-
Dylan Griffith authored
-
Dylan Griffith authored
-
Dylan Griffith authored
-
Filipa Lacerda authored
Docs fe vuex updates See merge request gitlab-org/gitlab-ce!18826
-
Rémy Coutable authored
Document the 3h timeout for GitLab.com shared Runners See merge request gitlab-org/gitlab-ce!18983
-
Dmitriy Zaporozhets authored
-