Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
00997da2
Commit
00997da2
authored
Mar 10, 2020
by
Alper Akgun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimizes the ci_pipelines counter query
Adds an index for batch counting in usage data
parent
533c399f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
changelogs/unreleased/208885-optimize-ci_pipeline-counters-related-to-the-ci-pipeline.yml
...imize-ci_pipeline-counters-related-to-the-ci-pipeline.yml
+5
-0
db/migrate/20200306170321_add_index_on_user_id_and_created_at_to_ci_pipelines.rb
...21_add_index_on_user_id_and_created_at_to_ci_pipelines.rb
+19
-0
db/schema.rb
db/schema.rb
+1
-1
No files found.
changelogs/unreleased/208885-optimize-ci_pipeline-counters-related-to-the-ci-pipeline.yml
0 → 100644
View file @
00997da2
---
title
:
Optimize ci_pipelines counters in usage data
merge_request
:
26774
author
:
type
:
performance
db/migrate/20200306170321_add_index_on_user_id_and_created_at_to_ci_pipelines.rb
0 → 100644
View file @
00997da2
# frozen_string_literal: true
class
AddIndexOnUserIdAndCreatedAtToCiPipelines
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:ci_pipelines
,
[
:user_id
,
:created_at
]
remove_concurrent_index
:ci_pipelines
,
[
:user_id
]
end
def
down
add_concurrent_index
:ci_pipelines
,
[
:user_id
]
remove_concurrent_index
:ci_pipelines
,
[
:user_id
,
:created_at
]
end
end
db/schema.rb
View file @
00997da2
...
@@ -873,7 +873,7 @@ ActiveRecord::Schema.define(version: 2020_03_06_170531) do
...
@@ -873,7 +873,7 @@ ActiveRecord::Schema.define(version: 2020_03_06_170531) do
t
.
index
[
"project_id"
,
"status"
,
"config_source"
],
name:
"index_ci_pipelines_on_project_id_and_status_and_config_source"
t
.
index
[
"project_id"
,
"status"
,
"config_source"
],
name:
"index_ci_pipelines_on_project_id_and_status_and_config_source"
t
.
index
[
"project_id"
,
"status"
,
"updated_at"
],
name:
"index_ci_pipelines_on_project_id_and_status_and_updated_at"
t
.
index
[
"project_id"
,
"status"
,
"updated_at"
],
name:
"index_ci_pipelines_on_project_id_and_status_and_updated_at"
t
.
index
[
"status"
],
name:
"index_ci_pipelines_on_status"
t
.
index
[
"status"
],
name:
"index_ci_pipelines_on_status"
t
.
index
[
"user_id"
],
name:
"index_ci_pipelines_on_user_id
"
t
.
index
[
"user_id"
,
"created_at"
],
name:
"index_ci_pipelines_on_user_id_and_created_at
"
end
end
create_table
"ci_pipelines_config"
,
primary_key:
"pipeline_id"
,
force: :cascade
do
|
t
|
create_table
"ci_pipelines_config"
,
primary_key:
"pipeline_id"
,
force: :cascade
do
|
t
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment