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
bacbe1a8
Commit
bacbe1a8
authored
Mar 10, 2020
by
Doug Stull
Committed by
Mayra Cabrera
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add index to optimize usage data counters
- needed for failing counters on .com due to long queries
parent
e7935f19
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
1 deletion
+44
-1
changelogs/unreleased/208887-optimize-project-counters-mirrored-pipelines.yml
...d/208887-optimize-project-counters-mirrored-pipelines.yml
+5
-0
db/migrate/20200309195209_add_index_on_project_id_and_builds_access_level_to_project_features.rb
...project_id_and_builds_access_level_to_project_features.rb
+18
-0
db/migrate/20200309195710_add_index_on_mirror_and_creator_id_and_created_at_to_projects.rb
...ex_on_mirror_and_creator_id_and_created_at_to_projects.rb
+18
-0
db/schema.rb
db/schema.rb
+3
-1
No files found.
changelogs/unreleased/208887-optimize-project-counters-mirrored-pipelines.yml
0 → 100644
View file @
bacbe1a8
---
title
:
Optimize Project counters with pipelines enabled counter
merge_request
:
26802
author
:
type
:
performance
db/migrate/20200309195209_add_index_on_project_id_and_builds_access_level_to_project_features.rb
0 → 100644
View file @
bacbe1a8
# frozen_string_literal: true
class
AddIndexOnProjectIdAndBuildsAccessLevelToProjectFeatures
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_project_features_on_project_id_bal_20'
disable_ddl_transaction!
def
up
add_concurrent_index
:project_features
,
:project_id
,
where:
'builds_access_level = 20'
,
name:
INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:project_features
,
INDEX_NAME
end
end
db/migrate/20200309195710_add_index_on_mirror_and_creator_id_and_created_at_to_projects.rb
0 → 100644
View file @
bacbe1a8
# frozen_string_literal: true
class
AddIndexOnMirrorAndCreatorIdAndCreatedAtToProjects
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_projects_on_mirror_creator_id_created_at'
disable_ddl_transaction!
def
up
add_concurrent_index
:projects
,
[
:creator_id
,
:created_at
],
where:
'mirror = true and mirror_trigger_builds = true'
,
name:
INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:projects
,
INDEX_NAME
end
end
db/schema.rb
View file @
bacbe1a8
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_03_0
6_170531
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_03_0
9_195710
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"pg_trgm"
...
...
@@ -3264,6 +3264,7 @@ ActiveRecord::Schema.define(version: 2020_03_06_170531) do
t
.
integer
"pages_access_level"
,
null:
false
t
.
integer
"forking_access_level"
t
.
index
[
"project_id"
],
name:
"index_project_features_on_project_id"
,
unique:
true
t
.
index
[
"project_id"
],
name:
"index_project_features_on_project_id_bal_20"
,
where:
"(builds_access_level = 20)"
end
create_table
"project_group_links"
,
id: :serial
,
force: :cascade
do
|
t
|
...
...
@@ -3465,6 +3466,7 @@ ActiveRecord::Schema.define(version: 2020_03_06_170531) do
t
.
index
[
"created_at"
,
"id"
],
name:
"index_projects_api_created_at_id_desc"
,
order:
{
id: :desc
}
t
.
index
[
"created_at"
,
"id"
],
name:
"index_projects_api_vis20_created_at"
,
where:
"(visibility_level = 20)"
t
.
index
[
"created_at"
,
"id"
],
name:
"index_projects_on_created_at_and_id"
t
.
index
[
"creator_id"
,
"created_at"
],
name:
"index_projects_on_mirror_creator_id_created_at"
,
where:
"((mirror = true) AND (mirror_trigger_builds = true))"
t
.
index
[
"creator_id"
],
name:
"index_projects_on_creator_id"
t
.
index
[
"description"
],
name:
"index_projects_on_description_trigram"
,
opclass: :gin_trgm_ops
,
using: :gin
t
.
index
[
"id"
,
"repository_storage"
,
"last_repository_updated_at"
],
name:
"idx_projects_on_repository_storage_last_repository_updated_at"
...
...
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