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
ad7d1607
Commit
ad7d1607
authored
Nov 26, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add events index on project_id and created_at
parent
242baf12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
1 deletion
+39
-1
changelogs/unreleased/53992-add-events-index-on-project-id-and-created-at.yml
...d/53992-add-events-index-on-project-id-and-created-at.yml
+5
-0
db/migrate/20181126150622_add_events_index_on_project_id_and_created_at.rb
...26150622_add_events_index_on_project_id_and_created_at.rb
+32
-0
db/schema.rb
db/schema.rb
+2
-1
No files found.
changelogs/unreleased/53992-add-events-index-on-project-id-and-created-at.yml
0 → 100644
View file @
ad7d1607
---
title
:
Add index for events on project_id and created_at
merge_request
:
23354
author
:
type
:
performance
db/migrate/20181126150622_add_events_index_on_project_id_and_created_at.rb
0 → 100644
View file @
ad7d1607
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AddEventsIndexOnProjectIdAndCreatedAt
<
ActiveRecord
::
Migration
[
5.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
(
*
index_arguments
)
end
def
down
remove_concurrent_index
(
*
index_arguments
)
end
private
def
index_arguments
[
:events
,
[
:project_id
,
:created_at
],
{
name:
'index_events_on_project_id_and_created_at'
}
]
end
end
db/schema.rb
View file @
ad7d1607
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201811
12103239
)
do
ActiveRecord
::
Schema
.
define
(
version:
201811
26150622
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -867,6 +867,7 @@ ActiveRecord::Schema.define(version: 20181112103239) do
t
.
string
"target_type"
t
.
index
[
"action"
],
name:
"index_events_on_action"
,
using: :btree
t
.
index
[
"author_id"
,
"project_id"
],
name:
"index_events_on_author_id_and_project_id"
,
using: :btree
t
.
index
[
"project_id"
,
"created_at"
],
name:
"index_events_on_project_id_and_created_at"
,
using: :btree
t
.
index
[
"project_id"
,
"id"
],
name:
"index_events_on_project_id_and_id"
,
using: :btree
t
.
index
[
"target_type"
,
"target_id"
],
name:
"index_events_on_target_type_and_target_id"
,
using: :btree
end
...
...
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