From c3b380f4ac0e5b1db4d459f32fa48da98f0a130e Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Tue, 7 Dec 2021 18:29:29 -0600 Subject: [PATCH] :sparkles: Run ANALYZE after database restore --- cmd/restore/restore.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/restore/restore.go b/cmd/restore/restore.go index 931950a6..78b497d6 100644 --- a/cmd/restore/restore.go +++ b/cmd/restore/restore.go @@ -110,7 +110,18 @@ func run(cmd *cobra.Command, args []string) (err error) { err := kubernetes.Exec(client, postgresPod, buildCommand(inputFormat, true), pr, os.Stdout, false) pw.Close() - ch <- err + if err != nil { + ch <- err + return + } + + err = kubernetes.Exec(client, postgresPod, buildCommand(sqlformat.Plain, false), strings.NewReader("analyze"), os.Stdout, false) + if err != nil { + ch <- err + return + } + + ch <- nil }() switch inputFormat {