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
342557b0
Commit
342557b0
authored
Jun 07, 2021
by
Pedro Pombeiro
Committed by
Adam Hegyi
Jun 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add additional index for reverse sorting order
parent
5049097d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
db/migrate/20210601125410_add_runners_created_at_index.rb
db/migrate/20210601125410_add_runners_created_at_index.rb
+4
-4
db/migrate/20210601133459_replace_runners_contacted_at_index.rb
...rate/20210601133459_replace_runners_contacted_at_index.rb
+4
-3
db/structure.sql
db/structure.sql
+6
-2
No files found.
db/migrate/20210601125410_add_runners_created_at_index.rb
View file @
342557b0
...
...
@@ -8,13 +8,13 @@ class AddRunnersCreatedAtIndex < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
INDEX_NAME
=
'index_ci_runners_on_created_at_and_id'
def
up
add_concurrent_index
:ci_runners
,
[
:created_at
,
:id
],
name:
INDEX_NAME
add_concurrent_index
:ci_runners
,
[
:created_at
,
:id
],
order:
{
id: :desc
},
name:
'index_ci_runners_on_created_at_and_id_desc'
add_concurrent_index
:ci_runners
,
[
:created_at
,
:id
],
order:
{
created_at: :desc
,
id: :desc
},
name:
'index_ci_runners_on_created_at_desc_and_id_desc'
end
def
down
remove_concurrent_index
:ci_runners
,
[
:created_at
,
:id
],
name:
INDEX_NAME
remove_concurrent_index
:ci_runners
,
[
:created_at
,
:id
],
order:
{
id: :desc
},
name:
'index_ci_runners_on_created_at_and_id_desc'
remove_concurrent_index
:ci_runners
,
[
:created_at
,
:id
],
order:
{
created_at: :desc
,
id: :desc
},
name:
'index_ci_runners_on_created_at_desc_and_id_desc'
end
end
db/migrate/20210601133459_replace_runners_contacted_at_index.rb
View file @
342557b0
...
...
@@ -9,16 +9,17 @@ class ReplaceRunnersContactedAtIndex < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
OLD_INDEX_NAME
=
'index_ci_runners_on_contacted_at'
NEW_INDEX_NAME
=
'index_ci_runners_on_contacted_at_and_id'
def
up
add_concurrent_index
:ci_runners
,
[
:contacted_at
,
:id
],
name:
NEW_INDEX_NAME
,
using:
'btree'
add_concurrent_index
:ci_runners
,
[
:contacted_at
,
:id
],
order:
{
id: :desc
},
name:
'index_ci_runners_on_contacted_at_and_id_desc'
,
using:
'btree'
add_concurrent_index
:ci_runners
,
[
:contacted_at
,
:id
],
order:
{
contacted_at: :desc
,
id: :desc
},
name:
'index_ci_runners_on_contacted_at_desc_and_id_desc'
,
using:
'btree'
remove_concurrent_index_by_name
:ci_runners
,
OLD_INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:ci_runners
,
NEW_INDEX_NAME
remove_concurrent_index_by_name
:ci_runners
,
'index_ci_runners_on_contacted_at_and_id_desc'
remove_concurrent_index_by_name
:ci_runners
,
'index_ci_runners_on_contacted_at_desc_and_id_desc'
add_concurrent_index
:ci_runners
,
:contacted_at
,
name:
OLD_INDEX_NAME
,
using:
'btree'
end
...
...
db/structure.sql
View file @
342557b0
...
...
@@ -22904,9 +22904,13 @@ CREATE INDEX index_ci_runner_projects_on_project_id ON ci_runner_projects USING
CREATE INDEX index_ci_runner_projects_on_runner_id ON ci_runner_projects USING btree (runner_id);
CREATE INDEX index_ci_runners_on_contacted_at_and_id
ON ci_runners USING btree (contacted_at, id
);
CREATE INDEX index_ci_runners_on_contacted_at_and_id
_desc ON ci_runners USING btree (contacted_at, id DESC
);
CREATE INDEX index_ci_runners_on_created_at_and_id ON ci_runners USING btree (created_at, id);
CREATE INDEX index_ci_runners_on_contacted_at_desc_and_id_desc ON ci_runners USING btree (contacted_at DESC, id DESC);
CREATE INDEX index_ci_runners_on_created_at_and_id_desc ON ci_runners USING btree (created_at, id DESC);
CREATE INDEX index_ci_runners_on_created_at_desc_and_id_desc ON ci_runners USING btree (created_at DESC, id DESC);
CREATE INDEX index_ci_runners_on_description_trigram ON ci_runners USING gin (description gin_trgm_ops);
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