Subject: SQL transactions executing from VMSS

From: chandan Kumar <[email-masked]>
Date: Tue, 22 Apr 2025 16:59:31 +0530

Hi Team,
Greetings!

Kindly help in below situation, where in I see slowness in response time
while I do testing running SQL transaction in batches from VMSS to postgres
database in flexible server(PaaS) 14.17 version. VMSS to IaaS(postgres db
on ubuntu) is faster than VMSs to PaaS. 14 version is same on both the
system. response size is same but response time is almost 2.5x more on
PaaS. I see dynatrace is showing more time is on waiting time. Query plan
is same on both the system. If i run single sql transaction from pg admin
it is executing in same time.
 what can cause this slowness, any idea please.
-- 
*With warm regards*
*     Chandan*

---

From: chandan Kumar <[email-masked]>
Date: Mon, 28 Apr 2025 13:55:51 +0530

Hello Team,
I did not get any answer till now.  If someone has any idea please help me
is getting this resolved. The issue is - database deployment , sql query to
database is slow when we run database script from vmss to postgres
database in flexible server.  both the servers are in US EAST under the
same subnet

---------- Forwarded message ---------
From: chandan Kumar <[email-masked]>
Date: Tue, Apr 22, 2025 at 4:59 PM
Subject: SQL transactions executing from VMSS
To: <[email-masked]>

Hi Team,
Greetings!

-- 
*With warm regards*
*     Chandan*

---

From: Laurenz Albe <[email-masked]>
Date: Mon, 28 Apr 2025 11:05:31 +0200

On Mon, 2025-04-28 at 13:55 +0530, chandan Kumar wrote:
> I did not get any answer till now.  If someone has any idea please help me is getting this resolved.
> The issue is - database deployment , sql query to database is slow when we run database script from
> vmss to postgres database in flexible server.  both the servers are in US EAST under the same subnet
> 
> Kindly help in below situation, where in I see slowness in response time while I do testing running
> SQL transaction in batches from VMSS to postgres database in flexible server(PaaS) 14.17 version.
> VMSS to IaaS(postgres db on ubuntu) is faster than VMSs to PaaS. 14 version is same on both the
> system. response size is same but response time is almost 2.5x more on PaaS. I see dynatrace is
> showing more time is on waiting time. Query plan is same on both the system. If i run single sql
> transaction from pg admin it is executing in same time.

I think that the answer you didn't get was as helpful as your problem description:

  "I got some statement that is slow, but I will neither tell you the statement nor
   show you the execution plan.  What is the cause of the slowness?"

Yours,
Laurenz Albe

---

From: Tom Lane <[email-masked]>
Date: Mon, 28 Apr 2025 07:02:01 -0400

>    show you the execution plan.  What is the cause of the slowness?"

The OP did say that the execution plan was the same on both servers.
That would appear to imply that the problem is in the client-side
software stack.  Unfortunately, this is not the place to come for
expertise in VMSS (I for one have no idea what that even is).
Suggest asking in whatever community exists around that software.

			regards, tom lane

---

From: Adrian Klaver <[email-masked]>
Date: Mon, 28 Apr 2025 08:34:00 -0700

On 4/28/25 01:25, chandan Kumar wrote:
> Hello Team,
> I did not get any answer till now.  If someone has any idea please help 
> me is getting this resolved. The issue is - database deployment , sql 
> query to database is slow when we run database script from vmss to 
> postgres database in flexible server.  both the servers are in US EAST 
> under the same subnet

1) Unravel the acronyms. I'm pretty sure  VMSS and Flexible server are 
referring to Azure services, but it would be better if that was 
explicitly stated.

2) Show your work. In other words include the query plan, database 
script and the dynatrace results in your response.

3) What is "If i run single sql transaction from pg admin
it is executing in same time." trying to say? The same query as you 
refer to earlier and how does a single query relate to the issue of 
running transactions in batches?

My guess is that the Flexible Server(PaaS) is imposing more of an 
overhead then running your own Postgres instance on IaaS(Azure?).

> From: *chandan Kumar* <[email-masked] 
> <mailto:[email-masked]>>
> To: <[email-masked] 
> <mailto:[email-masked]>>
> 
> 
> 
> Hi Team,
> Greetings!
> 
> while I do testing running SQL transaction in batches from VMSS to 
> postgres database in flexible server(PaaS) 14.17 version. VMSS to 
> IaaS(postgres db on ubuntu) is faster than VMSs to PaaS. 14 version is 
> same on both the system. response size is same but response time is 
> almost 2.5x more on PaaS. I see dynatrace is showing more time is on 
> waiting time. Query plan is same on both the system. If i run single sql 

-- 
Adrian Klaver
[email-masked]