Return-Path: <oracle-l-bounce@freelists.org>
X-Original-To: oracle-l@orafaq.com
Delivered-To: oracle-l@orafaq.com
Received: from smtp-aa.freelists.org (smtp-aa.freelists.org [23.23.80.81])
 by malta2546.startdedicated.com (Postfix) with ESMTPS id E6DF810066C373
 for <oracle-l@orafaq.com>; Mon, 16 Oct 2023 18:13:45 +0200 (CEST)
Received: from turing.freelists.org (turing [10.0.0.164])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by smtp-aa.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 238E840E79;
 Mon, 16 Oct 2023 16:13:45 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Postfix) with ESMTP id F2B3140776;
 Mon, 16 Oct 2023 16:13:44 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1697472825;
 bh=0+zUu2M/P3isVS1AWae+sBsBBvk1H88Fw4Qx12OWsxc=;
 h=From:Sender:Sender:From;
 b=BR/FO7OLfRtSIixQoQPlFRZuWD3K5XJ9CNFbs7ThnH/Ucwu45BCvG8Vn94MMSoiEF
	 JrzufhJ19lYekxaRzj/Pe00bCQ/MwmKJATLcx9H+mk7nLjOoHd+xKR84kheH+maNm7
	 VC7CcZc6o4swRfO7sNW3MqDtLPLq8jItJi/giT04=
X-Virus-Scanned: by FreeLists at turing.freelists.org
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id e9q-yuPB9z9x; Mon, 16 Oct 2023 16:13:44 +0000 (UTC)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Postfix) with ESMTP id E24A64A726;
 Mon, 16 Oct 2023 16:12:58 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1697472822;
 bh=0+zUu2M/P3isVS1AWae+sBsBBvk1H88Fw4Qx12OWsxc=;
 h=From:Sender:Sender:From;
 b=DKHljd1KqesIGhzdrFUPnOMDXg5SbB1iEZLDfRlKuQjQfbJYGVQox566V74VIEQ5e
	 E5Ndh34G46jhUxT8uFjvQFQDwTyAzT7kXNptSlmW09qLhmz5SuklhYrmKJWd6u9uBs
	 epRcnMfbYB0eiQc65BcL8F+9g3zoNE3y47hPKnOM=
Received: with ECARTIS (v1.0.0; list oracle-l); Mon, 16 Oct 2023 16:12:13 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Postfix) with ESMTP id BC1564079E
 for <oracle-l@freelists.org>; Mon, 16 Oct 2023 16:12:13 +0000 (UTC)
Authentication-Results: turing.freelists.org;
 dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=c0/7Mw+b;
 dkim-atps=neutral
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id G1pa_dch5KfF for <oracle-l@freelists.org>;
 Mon, 16 Oct 2023 16:12:13 +0000 (UTC)
Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by turing.freelists.org (Postfix) with ESMTPS id 9BF5F40729
 for <oracle-l@freelists.org>; Mon, 16 Oct 2023 16:12:13 +0000 (UTC)
Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-53de8fc1ad8so8193845a12.0
        for <oracle-l@freelists.org>; Mon, 16 Oct 2023 09:12:13 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1697472732; x=1698077532;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=39aowTrA8/iO1sGF0AXP5bxkko8z/qTOuPPvyvOEigw=;
        b=CvNehWcUJoQrU3PVRoPs6xyBT/YYb3Jq84sW9Th4PvP4HF4mGEowPcIc1kDZb+pBKG
         YP9CSeU2eBvbHgS0LpmTvPvPDgIxB97JggVRsmgJ8q+jllRP5qjZ1y0PtSkqMRnEQifp
         p29Y/M6TlsTeFL/qNMnCZ000dEjOoiqD7nKUVQWPcfJGYQ2zsC8VKWvlMUbBShb5/gPd
         kYumS8LX05rQpR4gk5uP8K1nrQpsj3v96n28RGn8bqinRjbeIg+FVHC0eEdagBHeWlkc
         4vVElOZ1VSiH26Xdb1qC/7xniEPX1dSbN3pM4Djo2TK+uwDCnViMNQAu/rlQ74e2NGPX
         9EOA==
X-Gm-Message-State: AOJu0Yw3J3fRd/H46D4WK6Kh6+lp7tIbOadMtH6xOEp+w8/eJhttrWlK
 GcfWbEve7aiQc0mf8jtVoXxQH/qSkAZL0x2qb4go3W3LixF64upAjFc=
X-Google-Smtp-Source: AGHT+IHkWDWc4/+3CkKY3UkpUEjHHautTgQRRN98E9RcdNL8CHGUMVcEnjRg929evuPZEiA+lY73ppvtxHkKl+8gHYI=
X-Received: by 2002:a17:906:d54f:b0:9be:68db:b763 with SMTP id
 cr15-20020a170906d54f00b009be68dbb763mr7838108ejc.71.1697472731832; Mon, 16
 Oct 2023 09:12:11 -0700 (PDT)
MIME-Version: 1.0
References: <CAG67e6R+98Q-xRWHmaEsDcRBNLzEdPuDD5pxrDTn95M68GFSJA@mail.gmail.com>
 <29cb9cfe-c512-4eef-995a-e20aa6f6f108@bluewin.ch>
In-Reply-To: <29cb9cfe-c512-4eef-995a-e20aa6f6f108@bluewin.ch>
From: Amit Saroha <eramitsaroha@gmail.com>
Date: Mon, 16 Oct 2023 12:11:27 -0400
Message-ID: <CAG67e6QGRipKsvuSo8KntcuHxJT=kO-YGqQ4231=aFMLsCJ=oA@mail.gmail.com>
Subject: Re: Improve SQL run time
To: Lothar Flatz <l.flatz@bluewin.ch>
Cc: "ORACLE-L (oracle-l@freelists.org)" <oracle-l@freelists.org>
Content-Type: multipart/alternative; boundary="0000000000003264d20607d7abe3"
X-archive-position: 84421
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: eramitsaroha@gmail.com
Precedence: normal
Reply-To: eramitsaroha@gmail.com
List-Help: <mailto:ecartis@freelists.org?Subject=help>
List-Unsubscribe: <mailto:oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-Subscribe: <mailto:oracle-l-request@freelists.org?Subject=subscribe>
List-Owner: <mailto:>
List-post: <mailto:oracle-l@freelists.org>
List-Archive: <https://www.freelists.org/archive/oracle-l>
X-list: oracle-l
--0000000000003264d20607d7abe3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Lothar,

Thank you for the valuable feedback.

I'll make the adjustments provided in the example and see how things
proceed.

Best Regards,
AMIT SAROHA


On Mon, Oct 16, 2023 at 11:39=E2=80=AFAM Lothar Flatz <l.flatz@bluewin.ch> =
wrote:

> Estimates are way wrong indexing could be improved.
> But since most of the time is spend on line 9-12 I would look first into
> elimination the select max(subquery) by using an analytic function as in
> this example:
>
>
> https://forums.oracle.com/ords/apexds/post/analytic-function-vs-subquery-=
8485
>
> Thanks
>
> Lothar
>
> Am 16.10.2023 um 17:07 schrieb Amit Saroha:
>
> Hi All,
>
> I'm executing the enclosed query and want to minimize the response time t=
o
> 10 seconds. The SQL monitor, SQL, and SQL Plan are enclosed for your
> feedback.
>
> Please evaluate and provide feedback and if more information is needed,
> please let me know.
>
> Thank you for your help in advance.
>
> Best Regards,
> Amit
>
>
>

--0000000000003264d20607d7abe3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi=C2=A0Lothar,<div><br></div><div>Thank you for the valua=
ble feedback.</div><div><br></div><div>I&#39;ll make the adjustments provid=
ed in the example and see how things proceed.</div><div><br clear=3D"all"><=
div><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_sign=
ature"><div dir=3D"ltr">Best Regards,<div>AMIT SAROHA</div></div></div></di=
v><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"=
gmail_attr">On Mon, Oct 16, 2023 at 11:39=E2=80=AFAM Lothar Flatz &lt;<a hr=
ef=3D"mailto:l.flatz@bluewin.ch">l.flatz@bluewin.ch</a>&gt; wrote:<br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

 =20
   =20
 =20
  <div>
    <div>Estimates are way wrong indexing could
      be improved.<br>
      But since most of the time is spend on line 9-12 I would look
      first into elimination the select max(subquery) by using an
      analytic function as in this example:<br>
      <br>
<a href=3D"https://forums.oracle.com/ords/apexds/post/analytic-function-vs-=
subquery-8485" target=3D"_blank">https://forums.oracle.com/ords/apexds/post=
/analytic-function-vs-subquery-8485</a><br>
      <br>
      Thanks<br>
      <br>
      Lothar<br>
      <br>
      Am 16.10.2023 um 17:07 schrieb Amit Saroha:<br>
    </div>
    <blockquote type=3D"cite">
     =20
      <div dir=3D"ltr">Hi All,
        <div><br>
        </div>
        <div>I&#39;m executing the enclosed query and want to minimize the
          response time to 10 seconds. The SQL monitor, SQL, and SQL
          Plan are enclosed for your feedback.<br>
          <br>
          Please evaluate and provide feedback and if more
          information=C2=A0is needed, please let me know.<br>
        </div>
        <div><br>
        </div>
        <div>Thank you for your help in advance.</div>
        <div><br clear=3D"all">
          <div>
            <div dir=3D"ltr" class=3D"gmail_signature">
              <div dir=3D"ltr">Best Regards,
                <div>Amit</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div>

--0000000000003264d20607d7abe3--
--
http://www.freelists.org/webpage/oracle-l


