Skip to content

A platform for community discussion. Free, open, simple.

DEV: Optimize IntermediateDB before running importer (#35112)

Gerhard Schlager26f617a03f48
diff --git a/migrations/lib/importer/executor.rb b/migrations/lib/importer/executor.rb
index 946166dfa81..0b134f4cdc8 100644
--- a/migrations/lib/importer/executor.rb
+++ b/migrations/lib/importer/executor.rb
@@ -14,6 +14,7 @@ module Migrations::Importer
def start
runtime =
::Migrations::DateHelper.track_time do
+ optimize_intermediate_db
execute_steps
ensure
cleanup
@@ -38,6 +39,10 @@ module Migrations::Importer
@intermediate_db.execute("ATTACH DATABASE ? AS #{alias_name}", db_path)
end
+ def optimize_intermediate_db
+ @intermediate_db.execute("PRAGMA optimize=0x10002")
+ end
+
def step_classes
steps_module = ::Migrations::Importer::Steps
classes =