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
4626bed9
Commit
4626bed9
authored
Apr 12, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the query performance to find unsynced job artifacts
parent
95ac1154
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
ee/app/finders/geo/job_artifact_registry_finder.rb
ee/app/finders/geo/job_artifact_registry_finder.rb
+1
-1
ee/db/geo/migrate/20180412213305_add_index_to_artifact_id_on_job_artifact_registry.rb
...3305_add_index_to_artifact_id_on_job_artifact_registry.rb
+17
-0
ee/db/geo/schema.rb
ee/db/geo/schema.rb
+2
-1
No files found.
ee/app/finders/geo/job_artifact_registry_finder.rb
View file @
4626bed9
...
...
@@ -141,7 +141,7 @@ module Geo
fdw_job_artifacts
.
joins
(
"LEFT OUTER JOIN job_artifact_registry
ON job_artifact_registry.artifact_id =
#{
fdw_job_artifacts_table
}
.id"
)
.
with_files_stored_locally
.
where
(
job_artifact_registry:
{
id:
nil
})
.
where
(
job_artifact_registry:
{
artifact_
id:
nil
})
.
where
.
not
(
id:
except_artifact_ids
)
end
...
...
ee/db/geo/migrate/20180412213305_add_index_to_artifact_id_on_job_artifact_registry.rb
0 → 100644
View file @
4626bed9
class
AddIndexToArtifactIdOnJobArtifactRegistry
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:job_artifact_registry
,
:artifact_id
end
def
down
if
index_exists?
(
:job_artifact_registry
,
:artifact_id
)
remove_concurrent_index
:job_artifact_registry_finder
,
:artifact_id
end
end
end
ee/db/geo/schema.rb
View file @
4626bed9
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201804
05074130
)
do
ActiveRecord
::
Schema
.
define
(
version:
201804
12213305
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -47,6 +47,7 @@ ActiveRecord::Schema.define(version: 20180405074130) do
t
.
boolean
"missing_on_primary"
,
default:
false
,
null:
false
end
add_index
"job_artifact_registry"
,
[
"artifact_id"
],
name:
"index_job_artifact_registry_on_artifact_id"
,
using: :btree
add_index
"job_artifact_registry"
,
[
"retry_at"
],
name:
"index_job_artifact_registry_on_retry_at"
,
using: :btree
add_index
"job_artifact_registry"
,
[
"success"
],
name:
"index_job_artifact_registry_on_success"
,
using: :btree
...
...
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