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 26EAC1003841E3
 for <oracle-l@orafaq.com>; Tue,  2 Feb 2021 18:48:16 +0100 (CET)
Received: from turing.freelists.org (ip-10-0-0-164.ec2.internal [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 76AEA456DE;
 Tue,  2 Feb 2021 17:48:14 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Postfix) with ESMTP id 6EE963F96B;
 Tue,  2 Feb 2021 17:48:14 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1612288094;
 bh=39m7+RKUxXcfTU8NZcjlvJNs44tzpMHbYeiwo2dWZV0=;
 h=From:Sender:Sender:From;
 b=U9irkfe3Q5ia7DCXuOIMtfbLmHguAUZtvPkTxw1cz9x5XxCcpQpEmzPpqCv8/sEM7
	 0QvMKrl/jcEkNNR1Ddy/2RBChjSW2sxbZ63MqT5L+ygCnXGMWmIOCt50Oh+O8SztiH
	 Mv56CQpGZlAfx7uphFyw1uQJi0Sl9FedcueWuiig=
X-Virus-Scanned: by FreeLists at turing2.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 oqcizDJp_JMn; Tue,  2 Feb 2021 17:48:14 +0000 (UTC)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Postfix) with ESMTP id 2E1503F971;
 Tue,  2 Feb 2021 17:48:12 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1612288093;
 bh=39m7+RKUxXcfTU8NZcjlvJNs44tzpMHbYeiwo2dWZV0=;
 h=From:Sender:Sender:From;
 b=rhH/+CtiQeBugl4U6D3ibONUX4yx2yHuPRFiELlhBt6w/IW7jRGMcg7WSm3/Nb8ju
	 KkgPkbH78jQ3WCW1Tu0eFp7vlgy4C6k9i3JjAShyrVlinfZBom4Y2AwovBHhCDpEpA
	 ZbrVGpetktumMBpBp0r3hI9EfPPfo759OSWi+GTM=
Received: with ECARTIS (v1.0.0; list oracle-l); Tue, 02 Feb 2021 17:48:11 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Postfix) with ESMTP id 069953F85E
 for <oracle-l@freelists.org>; Tue,  2 Feb 2021 17:48:11 +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=20161025 header.b=m6Qq06qp;
 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 Xd7ZC--u6ZRm for <oracle-l@freelists.org>;
 Tue,  2 Feb 2021 17:48:10 +0000 (UTC)
Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171])
 (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 E70C33F844
 for <oracle-l@freelists.org>; Tue,  2 Feb 2021 17:48:10 +0000 (UTC)
Received: by mail-qk1-f171.google.com with SMTP id a7so20602747qkb.13
        for <oracle-l@freelists.org>; Tue, 02 Feb 2021 09:48:10 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to;
        bh=ey7yPtLOCCu7+Ur7dLFveqC4r+R3Lp/gABpap4PvBI4=;
        b=hnxyLKClBW6X+jCiCS52yg7Ha6SLgDw1BsaQJE1XRF3RfdGekz7Pzrfi/gHs7e9cQ0
         ctOUTlxepOdfIQkqODBjgQaFH3sdBSSmfGmk8JBy3zp0mhRAm3mP2QGOnhrH7Q3UZUJx
         B/ocoeNi/7Re6eaim9WDLpYZYDfJWcleH3iTp6+yikWSyIl4CXyREbRvc6HwGQb8m1wY
         VhXPIBj6K8lnJS7+K/pqX1P0/88gfKBEZbFG1dyBuOnxwI0GqftDmY3nTZ43dFWFm3fd
         t15ihn/+5cP4eHoMD2NeUGK2ITYKDIJ1SNVYRQ7tdbi2/G0k6QP8L406L2CKwUCB6nRl
         AZsw==
X-Gm-Message-State: AOAM531Pko5Oc1r5w/QpyjSCmH8qQpgbZNXmRPTEoPddZ0hUE/VHGpmw
 dj/XBD6rG4dVd+GpVJ603Pe2oZQPYsU7xtkV616mIkgnsJ/lLw==
X-Google-Smtp-Source: ABdhPJzhc/MrpM9vnT86C270AcFPGuWQJhDhq3RUFmpuSXviTPucBzPAp1AJO4k1TZ0Nxn8mTR8LC8azGzy2go4f/wE=
X-Received: by 2002:a37:a58d:: with SMTP id o135mr21499725qke.204.1612288090382;
 Tue, 02 Feb 2021 09:48:10 -0800 (PST)
MIME-Version: 1.0
References: <CAKna9VYfit64QskJCDGhUnK=S_hydbbrPy3-E9yJMWrOR87=pg@mail.gmail.com>
 <CAKna9VZHgdXG4Y9DJwSPdGxKT5feF=Jwo5V6bsYbeuzi4nNRPg@mail.gmail.com>
 <CAGtsp8nw+6cR460arRvpEY+8AX-8bMKdgVtMiewCSDBxUo_28A@mail.gmail.com>
 <CAKna9VZ4NbV9=B=dm-7RhA-dXNAtSmhSGO-QpheusZRq2xY0uQ@mail.gmail.com>
 <CAGtsp8mbuuPRFz-3gcV=BM2ASi0d6LL79qBvWO=uDwCG6snA+Q@mail.gmail.com>
 <CAKna9VaJ_AiBRBYZtipDWeJes=qA3_FFJb1gRc=pY_Ts38G3+Q@mail.gmail.com>
 <CAGtsp8ndex_94zMB9F5sk3RYzLijY0xYUQMn73uaiHAcMX7qtg@mail.gmail.com>
 <CAKna9VZ7xG5HRc_qwVce_j63eac=M=B+JG1uodoCfFpcWqjOUw@mail.gmail.com> <CAKna9Vb7YHuQocbcp_0AZLQdMwzPdOXNQGs1Vg0tE6xnPsqE4A@mail.gmail.com>
In-Reply-To: <CAKna9Vb7YHuQocbcp_0AZLQdMwzPdOXNQGs1Vg0tE6xnPsqE4A@mail.gmail.com>
From: Jonathan Lewis <jlewisoracle@gmail.com>
Date: Tue, 2 Feb 2021 17:47:58 +0000
Message-ID: <CAGtsp8nkUS7Bz2iYQWzLj-ahXOa-_pSX1Ld4eaxrT_AMWnTexg@mail.gmail.com>
Subject: Re: Performance issue on query doing smart scan
To: Oracle L <oracle-l@freelists.org>
Content-Type: multipart/alternative; boundary="000000000000e723af05ba5e12e1"
X-archive-position: 78836
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: jlewisoracle@gmail.com
Precedence: normal
Reply-To: jlewisoracle@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: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
--000000000000e723af05ba5e12e1
Content-Type: text/plain; charset="UTF-8"

Deciding whether to talk to Oracle or not about the double decompression is
something you'll have to decide for yourself. You could show them the
figures I've raised (and then give them then entire set of non-zero figures
as a follow-up) and ask if double decompression is the correct
interpretation, and if there are any known bugs and related patches. It's
possible they'll just tell you to make your SQL more efficient and add
indexes to do less work.

As far as building the index is concerned. An interesting thought for
building the index is this:

You can create the index as unusable, and this will take virtually no time
at all.

Then you can start running 'alter index XXX rebuild partition YYY' from the
oldest end upwards.  (I assume that your millions of inserts/updates per
day are likely to be at the recent end of the data).

Oracle 11.2.0.4 is capable of using "TABLE EXPANSION" to split the query
into what is effectively a UNION ALL query against a view with a name like
VW_TE_nnn that uses index range scans for the partitions that have usable
indexes and tablescans for the partitions where the index is still
unusable.  Here's a linke to an article by Maria Colgan about the
transformation:
https://blogs.oracle.com/optimizer/optimizer-transformations:-table-expansion

Since you have 180 partitions, and since the plan will (should) split into
two distinct pieces, you can examine the SQL*Monitor report and see how
well the indexed branch performs relative to the tablescan part, and may
get some idea of how efficient the whole thing will be by the time you've
built the first 10 or 12 partitions.

Regards
Jonathan Lewis




On Tue, 2 Feb 2021 at 15:02, Lok P <loknath.73@gmail.com> wrote:

> Also Jonathan, apart from having the new index created(which will really
> need a lot of tests/agreement because this transaction table is 7TB in size
> and is exposed to heavy batch inserts happening each day 24/7,
> ~250-300million rows each day) to help cater this query,
>>
>>
>>>

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

<div dir=3D"ltr"><div dir=3D"ltr"><div><br></div><div>Deciding whether to t=
alk to Oracle or not about the double decompression is something you&#39;ll=
 have to decide for yourself. You could show them the figures I&#39;ve rais=
ed (and then give them then entire set of non-zero figures as a follow-up) =
and ask if double decompression is the correct interpretation, and if there=
 are any known bugs and related patches. It&#39;s possible they&#39;ll just=
 tell you to make your SQL more efficient and add indexes to do less work.<=
/div><div><br></div><div>As far as building the index is concerned. An inte=
resting thought for building the index is this:</div><div><br></div><div>Yo=
u can create the index as unusable, and this will take virtually no time at=
 all.</div><div><br></div><div>Then you can start running &#39;alter index =
XXX rebuild partition YYY&#39; from the oldest end upwards.=C2=A0 (I assume=
 that your millions of inserts/updates per day are likely to be at the rece=
nt end of the data).</div><div><br></div><div>Oracle 11.2.0.4 is capable of=
 using &quot;TABLE EXPANSION&quot; to split the query into what is effectiv=
ely a UNION ALL query against a view with a name like VW_TE_nnn that uses i=
ndex range scans for the partitions that have usable indexes and tablescans=
 for the partitions where the index is still unusable.=C2=A0 Here&#39;s a l=
inke to an article by Maria Colgan about the transformation: <a href=3D"htt=
ps://blogs.oracle.com/optimizer/optimizer-transformations:-table-expansion"=
>https://blogs.oracle.com/optimizer/optimizer-transformations:-table-expans=
ion</a></div><div><br></div><div>Since you have 180 partitions, and since t=
he plan will (should) split into two distinct pieces, you can examine the S=
QL*Monitor report and see how well the indexed branch performs relative to =
the tablescan part, and may get some idea of how efficient the whole thing =
will be by the time you&#39;ve built the first 10 or 12 partitions.<br></di=
v><div><br></div><div>Regards</div><div>Jonathan Lewis</div><div><br></div>=
<div><br></div><div><br></div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Tue, 2 Feb 2021 at 15:02, Lok P &lt;<a hre=
f=3D"mailto:loknath.73@gmail.com" target=3D"_blank">loknath.73@gmail.com</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"><di=
v dir=3D"ltr">Also Jonathan, apart from having the new index created(which =
will really need a lot=C2=A0of tests/agreement because this transaction tab=
le is 7TB in size and is exposed to heavy batch inserts happening each day =
24/7, ~250-300million rows each day) to help cater this query,<blockquote c=
lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli=
d rgb(204,204,204);padding-left:1ex"><div class=3D"gmail_quote"><blockquote=
 class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so=
lid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><br></div>
</blockquote></div>
</blockquote></div></blockquote><div>=C2=A0</div></div>
</div>

--000000000000e723af05ba5e12e1--
--
http://www.freelists.org/webpage/oracle-l


