Re: SQL performance issue after migration from Oracle to Aurora postgres

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Goti <aryan(dot)goti(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: SQL performance issue after migration from Oracle to Aurora postgres
Date: 2022-04-14 14:40:43
Message-ID: 8d3404ab-6d3f-f902-4be6-edac880bbd03@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance


On 2022-04-14 Th 05:35, Goti wrote:
> Hi All,
>
> We migrated from Oracle 12.1 to Aurora postgres 12.8.1. The query in
> Oracle takes less than a millisecond however the same query in aurora
> is taking more than a second. We have a larger number of executions
> for the SQL which is causing an overall latency for the application. I
> am new to postgres and trying to get some ideas around how better we
> can optimize. I have the plan details for the SQL as below. Can
> someone shed some light on possible ways that can make this query to
> meet its original execution time?
>
> https://explain.depesz.com/s/jlVc#html
>

Without knowing much about your data I would suggest trying to rewrite
the query to get rid of the correlated subselect, using a join instead.
I note the use of both implicit and explicit joins in your FROM clause,
which is something I always advise against, as it hurts clarity, but
that's a matter of style rather than performance.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kumar, Mukesh 2022-04-14 14:44:43 RE: Query Tunning related to function
Previous Message Ranier Vilela 2022-04-14 14:26:05 Re: Query Tunning related to function