                                    result))))
                         (filter map?)
                         (map ::vacuum-analyze)
-                        seq)))]
-    (when-not tables
+                        (apply set/union))))]
+    (when-not (empty? tables)
       (log/info (trs "There are no pending migrations")))
-    ;; Always analyze these since we had a good long period where
-    ;; the post-migration analysis above wasn't actually working,
-    ;; and since this shouldn't be expensive.
-    (analyze-if-exists (apply set/union small-tables tables))
-    (not (empty? tables))))
+    tables))
 
 
 ;; SPECIAL INDEX HANDLING

    (apply jdbc/do-commands-outside-txn
           (map #(str "vacuum analyze " %) tables))))

(defn run-migrations
  []
  (require-valid-schema)
  (let [small-tables (set ["value_types" "report_statuses"])
        tables (jdbc/with-db-transaction []
                 (when-let [pending (seq (pending-migrations))]
                   (->> pending
                        (map (fn [[version migration]]

   33 add-certname-id-to-certnames
   34 add-certname-id-to-resource-events
   ;; This dummy migration ensures that even databases that were up to
   ;; date when the analyze-tables code was added will still analyze
   ;; their existing databases.
   35 (fn [] true)
   36 rename-environments-name-to-environment
   37 add-jsonb-columns-for-metrics-and-logs
