Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
6bc6a801
Commit
6bc6a801
authored
1 year ago
by
Dan Notestein
Browse files
Options
Downloads
Patches
Plain Diff
Try dropping foreign keys before indexes.
parent
c2f8c538
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!827
Merge develop changes to master
,
!608
Try dropping foreign keys before indexes and add performance timing for it.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/db/db_state.py
+9
-4
9 additions, 4 deletions
hive/db/db_state.py
with
9 additions
and
4 deletions
hive/db/db_state.py
+
9
−
4
View file @
6bc6a801
...
...
@@ -270,13 +270,18 @@ class DbState:
log
.
info
(
"
[MASSIVE] Skipping pre-massive sync hooks
"
)
return
# is_pre_process, drop, create
cls
.
processing_indexes
(
True
,
True
,
False
)
log
.
info
(
"
Dropping foreign keys
"
)
from
hive.db.schema
import
drop_fk
log
.
info
(
"
Dropping FKs
"
)
time_start
=
perf_counter
()
drop_fk
(
cls
.
db
())
end_time
=
perf_counter
()
elapsed_time
=
end_time
-
time_start
log
.
info
(
"
Dropped foreign keys: %.4f s
"
,
elapsed_time
)
# is_pre_process, drop, create
cls
.
processing_indexes
(
True
,
True
,
False
)
# intentionally disabled since it needs a lot of WAL disk space when switching back to LOGGED
# set_logged_table_attribute(cls.db(), False)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment