Skip to content
Snippets Groups Projects
Commit 6bc6a801 authored by Dan Notestein's avatar Dan Notestein
Browse files

Try dropping foreign keys before indexes.

parent c2f8c538
No related branches found
No related tags found
2 merge requests!827Merge develop changes to master,!608Try dropping foreign keys before indexes and add performance timing for it.
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment