Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pl0Nk-0003BL-6m for pgsql-performance@arkaria.postgresql.org; Sat, 08 Apr 2023 04:40:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pl0Ni-0007Qw-Qh for pgsql-performance@arkaria.postgresql.org; Sat, 08 Apr 2023 04:40:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pl0Ni-0007Qm-GY for pgsql-performance@lists.postgresql.org; Sat, 08 Apr 2023 04:40:54 +0000 Received: from resqmta-c1p-023465.sys.comcast.net ([2001:558:fd00:56::5]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pl0Nc-001ZiV-0V for pgsql-performance@lists.postgresql.org; Sat, 08 Apr 2023 04:40:51 +0000 Received: from resomta-c1p-022590.sys.comcast.net ([96.102.18.239]) by resqmta-c1p-023465.sys.comcast.net with ESMTP id l0AkpgLJg0bDpl0NTp3mwX; Sat, 08 Apr 2023 04:40:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1680928839; bh=G7USQXyQXeJ4xVPr2nkngCj2eNn1+FfH/1oP/nFRcr4=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type:Xfinity-Spam-Result; b=zyFjSkAO8kShtfMrjEZKdQOcDQL0RMhb/o29qEnPSijn+cLbCcPJ9T84wc6Uf0kTe eTNzRnVzLMVUMD5AjTHSAaAUe08TXMLsWmWMidsmA8yMKFt2pJZBctXmwXanSf38Q7 Fc+Vip5oXlcFstdMgTxh04AcIiDE6YtdujY9KVemGmLHNPHqO7mGictzN9X2zMUDSz 1veZePkVs4/RjJx2Ojj4slVXHjl8ql7zvar/ygDmsH56Fnr0PHjoTgBY7E8WC1cKpB cgKxCyNFEwoEXh/x53JftWiu7iaXHAhTYMK/paekSxENflFjJN9mFVBf66yAyY11Bu TNC2f+hY9W/MA== Received: from R9N0YC2TC3.localdomain ([IPv6:2601:249:8780:7950:1dec:20f5:ab3c:37ba]) by resomta-c1p-022590.sys.comcast.net with ESMTPA id l0NQpFm3NiB9Zl0NSpmZtS; Sat, 08 Apr 2023 04:40:38 +0000 X-Xfinity-VMeta: sc=-100.00;st=legit Received: by R9N0YC2TC3.localdomain (Postfix, from userid 503) id CCB5D16760BC; Fri, 7 Apr 2023 23:40:36 -0500 (CDT) From: Jerry Sievers To: kunwar singh Cc: pgsql-performance@lists.postgresql.org Subject: Re: Is there any tool which will help me run and explain analyze about 150 queries? References: Date: Fri, 07 Apr 2023 23:40:36 -0500 In-Reply-To: (kunwar singh's message of "Fri, 7 Apr 2023 13:57:32 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin) MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk kunwar singh writes: > Hi Listers, > Anyone here use such a tool for Postgres? Any recommendations? > > Say I have 150 queries in Postgres 11 and I want to upgrade to Postgres 15. I want to run explain analyze for 150 in both versions for comparative > analysis. > > I am looking for the easiest way to do it with a tool :) I'd use a tool like bash for this which is very affordable :-) Just load your queries into individual files in some directory with a .sql suffix... for file in $some-directory/*.sql; do psql <$file.explain-output 2>&1 explain analyze $(<$file) EOF done