Skip to content
Snippets Groups Projects
Unverified Commit ff312a05 authored by Pawit Pornkitprasan's avatar Pawit Pornkitprasan Committed by GitHub
Browse files

Revert "VACUUM and ANALYZE after insert" (#18665)

This reverts commit c6688f5caf226c6ec5be424859fc00b93665620f.

Redshift only supports VACUUM command at a time on the whole
cluster, so running VACUUM can fail with parallel executions.
parent d7b6dfab
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,6 @@
[metabase.driver.sql-jdbc.sync :as sql-jdbc.sync]
[metabase.test.data.interface :as tx]
[metabase.test.data.sql :as sql.tx]
[metabase.test.data.sql-jdbc.load-data :as load-data]
[metabase.test.data.sql.ddl :as ddl]
[metabase.util :as u]))
......@@ -70,15 +69,6 @@
[& args]
(apply sql.tx/drop-table-if-exists-cascade-sql args))
(defmethod load-data/load-data! :redshift
[driver {:keys [database-name], :as dbdef} {:keys [table-name], :as tabledef}]
(load-data/load-data-all-at-once! driver dbdef tabledef)
(let [table-identifier (sql.tx/qualify-and-quote :redshift database-name table-name)
spec (sql-jdbc.conn/connection-details->spec :redshift @db-connection-details)]
;; VACUUM and ANALYZE after insert to improve performance (according to doc)
(jdbc/execute! spec (str "VACUUM " table-identifier) {:transaction? false})
(jdbc/execute! spec (str "ANALYZE " table-identifier) {:transaction? false})))
;;; Create + destroy the schema used for this test session
(defn execute! [format-string & args]
......
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