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
7bd2480c
Commit
7bd2480c
authored
Mar 03, 2020
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add trigram index on snippet description
parent
ec226316
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
changelogs/unreleased/199220-snippet-index-desc.yml
changelogs/unreleased/199220-snippet-index-desc.yml
+5
-0
db/migrate/20200303074328_add_index_on_snippet_description.rb
...igrate/20200303074328_add_index_on_snippet_description.rb
+18
-0
db/schema.rb
db/schema.rb
+2
-1
No files found.
changelogs/unreleased/199220-snippet-index-desc.yml
0 → 100644
View file @
7bd2480c
---
title
:
Add trigram index on snippet description
merge_request
:
26341
author
:
type
:
performance
db/migrate/20200303074328_add_index_on_snippet_description.rb
0 → 100644
View file @
7bd2480c
# frozen_string_literal: true
class
AddIndexOnSnippetDescription
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
INDEX_NAME
=
'index_snippets_on_description_trigram'
disable_ddl_transaction!
def
up
add_concurrent_index
:snippets
,
:description
,
name:
INDEX_NAME
,
using: :gin
,
opclass:
{
description: :gin_trgm_ops
}
end
def
down
remove_concurrent_index_by_name
:snippets
,
INDEX_NAME
end
end
db/schema.rb
View file @
7bd2480c
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2020_0
2_27_165129
)
do
ActiveRecord
::
Schema
.
define
(
version:
2020_0
3_03_074328
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"pg_trgm"
...
...
@@ -3964,6 +3964,7 @@ ActiveRecord::Schema.define(version: 2020_02_27_165129) do
t
.
index
[
"author_id"
],
name:
"index_snippets_on_author_id"
t
.
index
[
"content"
],
name:
"index_snippets_on_content_trigram"
,
opclass: :gin_trgm_ops
,
using: :gin
t
.
index
[
"created_at"
],
name:
"index_snippets_on_created_at"
t
.
index
[
"description"
],
name:
"index_snippets_on_description_trigram"
,
opclass: :gin_trgm_ops
,
using: :gin
t
.
index
[
"file_name"
],
name:
"index_snippets_on_file_name_trigram"
,
opclass: :gin_trgm_ops
,
using: :gin
t
.
index
[
"project_id"
,
"visibility_level"
],
name:
"index_snippets_on_project_id_and_visibility_level"
t
.
index
[
"title"
],
name:
"index_snippets_on_title_trigram"
,
opclass: :gin_trgm_ops
,
using: :gin
...
...
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