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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
58a99463
Commit
58a99463
authored
Mar 20, 2018
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add indexes for user activity queries.
Closes #44446.
parent
aa2a97b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
changelogs/unreleased/ab-44446-add-indexes-for-user-activity-queries.yml
...leased/ab-44446-add-indexes-for-user-activity-queries.yml
+5
-0
db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb
...e/20180320182229_add_indexes_for_user_activity_queries.rb
+17
-0
db/schema.rb
db/schema.rb
+3
-1
No files found.
changelogs/unreleased/ab-44446-add-indexes-for-user-activity-queries.yml
0 → 100644
View file @
58a99463
---
title
:
Add indexes for user activity queries.
merge_request
:
17890
author
:
type
:
performance
db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb
0 → 100644
View file @
58a99463
class
AddIndexesForUserActivityQueries
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:events
,
[
:project_id
,
:author_id
]
add_concurrent_index
:user_interacted_projects
,
:user_id
end
def
down
remove_concurrent_index
:events
,
[
:project_id
,
:author_id
]
remove_concurrent_index
:user_interacted_projects
,
:user_id
end
end
db/schema.rb
View file @
58a99463
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201803
09160427
)
do
ActiveRecord
::
Schema
.
define
(
version:
201803
20182229
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -728,6 +728,7 @@ ActiveRecord::Schema.define(version: 20180309160427) do
add_index
"events"
,
[
"action"
],
name:
"index_events_on_action"
,
using: :btree
add_index
"events"
,
[
"author_id"
],
name:
"index_events_on_author_id"
,
using: :btree
add_index
"events"
,
[
"project_id"
,
"author_id"
],
name:
"index_events_on_project_id_and_author_id"
,
using: :btree
add_index
"events"
,
[
"project_id"
,
"id"
],
name:
"index_events_on_project_id_and_id"
,
using: :btree
add_index
"events"
,
[
"target_type"
,
"target_id"
],
name:
"index_events_on_target_type_and_target_id"
,
using: :btree
...
...
@@ -1863,6 +1864,7 @@ ActiveRecord::Schema.define(version: 20180309160427) do
end
add_index
"user_interacted_projects"
,
[
"project_id"
,
"user_id"
],
name:
"index_user_interacted_projects_on_project_id_and_user_id"
,
unique:
true
,
using: :btree
add_index
"user_interacted_projects"
,
[
"user_id"
],
name:
"index_user_interacted_projects_on_user_id"
,
using: :btree
create_table
"user_synced_attributes_metadata"
,
force: :cascade
do
|
t
|
t
.
boolean
"name_synced"
,
default:
false
...
...
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