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
e394a19e
Commit
e394a19e
authored
May 20, 2020
by
Saikat Sarkar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ci_builds_on_commit_id_and_artifacts_expireatandidpartial index
parent
32a9c16b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
2 deletions
+44
-2
changelogs/unreleased/update-index-artifacts-expire.yml
changelogs/unreleased/update-index-artifacts-expire.yml
+6
-0
db/migrate/20200519171058_update_index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial.rb
...builds_on_commit_id_and_artifacts_expireatandidpartial.rb
+35
-0
db/structure.sql
db/structure.sql
+3
-2
No files found.
changelogs/unreleased/update-index-artifacts-expire.yml
0 → 100644
View file @
e394a19e
---
title
:
Update index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial index
for secret_detection
merge_request
:
32584
author
:
type
:
performance
db/migrate/20200519171058_update_index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial.rb
0 → 100644
View file @
e394a19e
# frozen_string_literal: true
class
UpdateIndexCiBuildsOnCommitIdAndArtifactsExpireatandidpartial
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
OLD_INDEX_NAME
=
'index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial'
NEW_INDEX_NAME
=
'index_ci_builds_on_commit_id_artifacts_expired_at_and_id'
OLD_CLAUSE
=
"type::text = 'Ci::Build'::text AND (retried = false OR retried IS NULL) AND
(name::text = ANY (ARRAY['sast'::character varying,
'dependency_scanning'::character varying,
'sast:container'::character varying,
'container_scanning'::character varying,
'dast'::character varying]::text[]))"
NEW_CLAUSE
=
"type::text = 'Ci::Build'::text AND (retried = false OR retried IS NULL) AND
(name::text = ANY (ARRAY['sast'::character varying,
'secret_detection'::character varying,
'dependency_scanning'::character varying,
'container_scanning'::character varying,
'dast'::character varying]::text[]))"
def
up
add_concurrent_index
:ci_builds
,
[
:commit_id
,
:artifacts_expire_at
,
:id
],
name:
NEW_INDEX_NAME
,
where:
NEW_CLAUSE
remove_concurrent_index_by_name
:ci_builds
,
OLD_INDEX_NAME
end
def
down
add_concurrent_index
:ci_builds
,
[
:commit_id
,
:artifacts_expire_at
,
:id
],
name:
OLD_INDEX_NAME
,
where:
OLD_CLAUSE
remove_concurrent_index_by_name
:ci_builds
,
NEW_INDEX_NAME
end
end
db/structure.sql
View file @
e394a19e
...
...
@@ -9228,8 +9228,6 @@ CREATE INDEX index_ci_builds_on_artifacts_expire_at ON public.ci_builds USING bt
CREATE
INDEX
index_ci_builds_on_auto_canceled_by_id
ON
public
.
ci_builds
USING
btree
(
auto_canceled_by_id
);
CREATE
INDEX
index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial
ON
public
.
ci_builds
USING
btree
(
commit_id
,
artifacts_expire_at
,
id
)
WHERE
(((
type
)::
text
=
'Ci::Build'
::
text
)
AND
((
retried
=
false
)
OR
(
retried
IS
NULL
))
AND
((
name
)::
text
=
ANY
(
ARRAY
[(
'sast'
::
character
varying
)::
text
,
(
'dependency_scanning'
::
character
varying
)::
text
,
(
'sast:container'
::
character
varying
)::
text
,
(
'container_scanning'
::
character
varying
)::
text
,
(
'dast'
::
character
varying
)::
text
])));
CREATE
INDEX
index_ci_builds_on_commit_id_and_stage_idx_and_created_at
ON
public
.
ci_builds
USING
btree
(
commit_id
,
stage_idx
,
created_at
);
CREATE
INDEX
index_ci_builds_on_commit_id_and_status_and_type
ON
public
.
ci_builds
USING
btree
(
commit_id
,
status
,
type
);
...
...
@@ -9238,6 +9236,8 @@ CREATE INDEX index_ci_builds_on_commit_id_and_type_and_name_and_ref ON public.ci
CREATE
INDEX
index_ci_builds_on_commit_id_and_type_and_ref
ON
public
.
ci_builds
USING
btree
(
commit_id
,
type
,
ref
);
CREATE
INDEX
index_ci_builds_on_commit_id_artifacts_expired_at_and_id
ON
public
.
ci_builds
USING
btree
(
commit_id
,
artifacts_expire_at
,
id
)
WHERE
(((
type
)::
text
=
'Ci::Build'
::
text
)
AND
((
retried
=
false
)
OR
(
retried
IS
NULL
))
AND
((
name
)::
text
=
ANY
(
ARRAY
[(
'sast'
::
character
varying
)::
text
,
(
'secret_detection'
::
character
varying
)::
text
,
(
'dependency_scanning'
::
character
varying
)::
text
,
(
'container_scanning'
::
character
varying
)::
text
,
(
'dast'
::
character
varying
)::
text
])));
CREATE
INDEX
index_ci_builds_on_project_id_and_id
ON
public
.
ci_builds
USING
btree
(
project_id
,
id
);
CREATE
INDEX
index_ci_builds_on_project_id_and_name_and_ref
ON
public
.
ci_builds
USING
btree
(
project_id
,
name
,
ref
)
WHERE
(((
type
)::
text
=
'Ci::Build'
::
text
)
AND
((
status
)::
text
=
'success'
::
text
)
AND
((
retried
=
false
)
OR
(
retried
IS
NULL
)));
...
...
@@ -13920,5 +13920,6 @@ COPY "schema_migrations" (version) FROM STDIN;
20200514000340
20200515155620
20200519115908
20200519171058
\
.
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