Re: Is there any tool which will help me run and explain analyze about 150 queries?

From: Jerry Sievers <gsievers19(at)comcast(dot)net>
To: kunwar singh <krishsingh(dot)111(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Is there any tool which will help me run and explain analyze about 150 queries?
Date: 2023-04-08 04:40:36
Message-ID: m04jprx9yz.fsf@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

kunwar singh <krishsingh(dot)111(at)gmail(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message msalais 2023-04-08 17:58:46 RE: Query unable to utilize index without typecast to fixed length character
Previous Message kunwar singh 2023-04-07 20:48:59 Re: Is there any tool which will help me run and explain analyze about 150 queries?