Re: Is there any tool which will help me run and explain analyze about 150 queries? - Mailing list pgsql-performance

From kyle Hailey
Subject Re: Is there any tool which will help me run and explain analyze about 150 queries?
Date
Msg-id CADsdiQjKUWcc9UWPGrtu0SG-tbRPaN11w7aNTcqVBiwEqYG0FQ@mail.gmail.com
Whole thread Raw
In response to Re: Is there any tool which will help me run and explain analyze about 150 queries?  (Jerry Sievers <gsievers19@comcast.net>)
Responses Re: Is there any tool which will help me run and explain analyze about 150 queries?
List pgsql-performance

Just wrote up my experiences setting up auto_explain on Google Cloud SQL to get explain analyze:





On Fri, Apr 7, 2023 at 9:40 PM Jerry Sievers <gsievers19@comcast.net> wrote:
kunwar singh <krishsingh.111@gmail.com> 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 <<EOF >$file.explain-output 2>&1
explain analyze
$(<$file)
EOF
done


pgsql-performance by date:

Previous
From:
Date:
Subject: RE: Query unable to utilize index without typecast to fixed length character
Next
From: kunwar singh
Date:
Subject: Re: Is there any tool which will help me run and explain analyze about 150 queries?