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 34B1110031AF22
 for <oracle-l@orafaq.com>; Fri, 17 Dec 2021 10:47:27 +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 DEF8B40986;
 Fri, 17 Dec 2021 09:47:25 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Postfix) with ESMTP id C78C73F9C9;
 Fri, 17 Dec 2021 09:47:25 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1639734445;
 bh=BbyQPRAjzmO1jpFMchoc0Ps7XfdDp/sgFg8IOUAsZgw=;
 h=From:Sender:Sender:From;
 b=by2v/0Kwh+rm+EKo+5+Qqp9Z1o1LJQ6N2Y0R6bH82pxJHRO5nJ5booPMlH8EkKXfw
	 0Ly7DZUibxUgh27yXrUh0dUVayKWvaLjAADEiGRKab6VDgf7D5qWMDqUriMpXixh8C
	 IDMS/PTZpxlIvddQPkBly+q7xZ6LoE2utZNXeNpk=
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 i-oi0D_ve5eK; Fri, 17 Dec 2021 09:47:25 +0000 (UTC)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Postfix) with ESMTP id C13083FB5A;
 Fri, 17 Dec 2021 09:47:22 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1639734444;
 bh=BbyQPRAjzmO1jpFMchoc0Ps7XfdDp/sgFg8IOUAsZgw=;
 h=From:Sender:Sender:From;
 b=NYbOk7UxCxCT2u228hfvNwKkImKYemetADIRqqb+jjRfzbKY1SErMgRD0rsaUxaRo
	 ERDsCC3WD555pMO74SKbvy8vYkOoH74Zar84E7pNDwlBbiHwDSuGQBT+r/p3OXMzO6
	 1Iu8HqS5bt6ac7eYlKtfX+qo+EWVIc4NWCLNEm6M=
Received: with ECARTIS (v1.0.0; list oracle-l); Fri, 17 Dec 2021 09:47:21 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Postfix) with ESMTP id 0D6153F9C9
 for <oracle-l@freelists.org>; Fri, 17 Dec 2021 09:47:21 +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=20210112 header.b=NplwipV/;
 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 44erAmb3yV6P for <oracle-l@freelists.org>;
 Fri, 17 Dec 2021 09:47:21 +0000 (UTC)
Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45])
 (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 EBCCE3F7AB
 for <oracle-l@freelists.org>; Fri, 17 Dec 2021 09:47:20 +0000 (UTC)
Received: by mail-ed1-f45.google.com with SMTP id y12so5491416eda.12
        for <oracle-l@freelists.org>; Fri, 17 Dec 2021 01:47:20 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20210112;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=b1aWprzndEwDlZKOmkyAJNOk/HI/fjWTEySbpnVdigs=;
        b=0Z2xRaa2ZEReawhNKxsBUH3ZdpMcmmLKwdWzybfZ02vVfA6W5Q2LAUFCsY6udITh43
         yz/rffa2gIuQm+4pIzelPFRkP0xEPFW+MochW/A7xjalFJEnJuTfmUNW/lkRNipURlI3
         5QmSrh//Fdq2u+yLoLH4peVXBDxSmZ+6KsjFgmxQwxxgvgJq+p28ANBzRYIBbqQ4Fdsp
         SlXtzDr86z28ivYkhBz6ZKbNHAGSn9r+0YndyCryCRrTWRqGBUudO7a3ubOsQyBIuzTQ
         2Zjovs7bTCl9SacDofGkF9xG1GZSvqzbqBAl4VnrUpRlDGdqZ55CteoZw2/JStBLVY69
         lugA==
X-Gm-Message-State: AOAM533ETl+1/MeAcRlRLRRg+oHtYmzd5PkF8yXqtnI5EKEB1Qz8rViy
 JGty5eSD3bjHwGaqC537OolBnmFxiEtanxtPA24=
X-Google-Smtp-Source: ABdhPJwFdcENOJUwBNJqQeJ1FTYUG/BsatX/Bwql2DPqoGJgjjZqT7xpEyKE7rdo13kz23nVzEXj8bFZ8a+gTC0CGBA=
X-Received: by 2002:a05:6402:50cf:: with SMTP id h15mr2106677edb.90.1639734439850;
 Fri, 17 Dec 2021 01:47:19 -0800 (PST)
MIME-Version: 1.0
References: <CAEjw_fhCEGxhKN=UKvSpj=FKJdnS_v5uoyr_dvd=AXgnapjLyw@mail.gmail.com>
 <CA+riqSUEzk7UFNrKZ0FZ=X1DkzpXKaEaM8Rw1T1HkzPFMyRJZQ@mail.gmail.com>
 <CAEjw_fiztzWCLgyZSjMT5+ySBhT1BDmaOjUKm7vhiT-XodM8mQ@mail.gmail.com>
 <55p-PDX85_zCh_GWlYkGZSUF9bSRVXfGiuixroaemoqVFYuFESjt3o5VTgG9z41X7fpdouFskiI4I_w0bPX7RMa1jhgRNzc0LsEwFIR56tM=@klockmail.com>
 <CAEjw_fgsuuvBriVn53VjUZQ3tCvmdYSsrWqMWTujwgw6KMgxCA@mail.gmail.com>
In-Reply-To: <CAEjw_fgsuuvBriVn53VjUZQ3tCvmdYSsrWqMWTujwgw6KMgxCA@mail.gmail.com>
From: Mohamed Houri <mohamed.houri@gmail.com>
Date: Fri, 17 Dec 2021 10:47:09 +0100
Message-ID: <CAJu8R6jF+_piUOqE+x_Y7r2XVtBDZjK=f+DykVxZ5bXth6pkJw@mail.gmail.com>
Subject: Re: Priority of profile baseline patch
To: Pap <oracle.developer35@gmail.com>
Cc: Andy Klock <andy@klockmail.com>, Laurentiu Oprea <laurentiu.oprea06@gmail.com>,
 Oracle L <oracle-l@freelists.org>
Content-Type: multipart/alternative; boundary="000000000000d039db05d3546c41"
X-archive-position: 81598
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: mohamed.houri@gmail.com
Precedence: normal
Reply-To: mohamed.houri@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
--000000000000d039db05d3546c41
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello

 *In other words the sql profile or sql patch helps to create new plans
based on the embedded hints however presence of baseline with
accepted +enabled flag as 'YES' is always going to rule at the end. Correct
if my understanding is wrong here?*

 The underlined part is incorrect

 If you look at the picture I designed in this article


https://hourim.wordpress.com/2015/10/01/oracle-optimizer-and-spm-plan-inter=
action/

You will realize that the presence of an SPM has *no influence on the
ordinary work of the CBO*. Initially, Oracle will produce its execution
plan ignoring the presence or absence of an SPM.

When generating this execution plan, all things being equal, Oracle will
use the set of hints contained in the SQL Profile or the SQL patch. *It is
only when the execution plan has been generated that the SPM finally comes
into play.*

And what exactly will this SPM do?

It will simply ensure that only the execution plan contained in the SPM
baseline will be used regardless of how this plan has been generated, via
SQL Profile, via SQL patch, or without any of those two features.

Of course, this insurance against a bad surprise(a non-desired execution
plan) is only possible if the plan in the SPM is reproducible at the time
of the execution of the request.

Hope this is clear

Best regards

Mohamed Houri



Le ven. 17 d=C3=A9c. 2021 =C3=A0 05:18, Pap <oracle.developer35@gmail.com> =
a =C3=A9crit :

> Thank you so much Andy.
>
> If I get it correct, it's the sql profile(which is generally a combinatio=
n
> of opt_estimate hints) which oracle will use to evaluate the plans but it=
's
> ultimately the sqlplan baselines (which must be in accepted+enabled) stat=
e
> which is going to be used finally.
>
> And in scenarios where we use technique to manually create sql profile by
> passing exact outline hints (but not with opt_etsimate hints) i.e. using
> procedure dbms_sqltune.import_sql_profile where we have ability to pass
> the exact full query outline hints which restricts the execution path to
> one. In those cases it will mostly fix the exact one execution path for t=
he
> query no matter how many times it parses. And in the presence of such a s=
ql
> profile , if the sql plan baseline has exactly the same path
> enabled+accepted that is going to be used or else it's going to be
> completely discarded and the priority will be given to the baseline which
> is in accepted+enabled state. (And the discarded plan i.e the parsed plan
> using sql profile may be added a new baseline to the list with accepted
> flag as NO).   Which means sql plan baseline having enabled+accepted flag
> as "YES" will take the precedence always irrespective of sql profile/sq
> patch etc. Is this understanding correct?
> Or
> In other words the sql profile or sql patch helps to create new plans
> based on the embedded hints however presence of baseline with
> accepted +enabled flag as 'YES' is always going to rule at the end. Corre=
ct
> if my understanding is wrong here?
>
> On Fri, Dec 17, 2021 at 1:53 AM Andy Klock <andy@klockmail.com> wrote:
>
>> Hi Laurentiu,
>>
>> =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original=
 Message =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90
>> On Thursday, December 16th, 2021 at 3:08 PM, Pap <
>> oracle.developer35@gmail.com> wrote:
>>
>> So in cases where the SQL profile or SQL patch has some hints (say FTS o=
n
>> tab1) which is exactly opposite than that of the one in SQL plan
>> baseline(say index access for tab1). In that scenario will oracle follow
>> profile/patch or the baseline path?
>>
>>
>> If a cursor has "accepted" baselines, then that is typically what the CB=
O
>> is going to prefer.  When there are multiple accepted plans, then the CB=
O
>> will pick the plan with the lowest cost. For cursors that also have a SQ=
L
>> Profile, then those hints and opt_estimates are applied which may affect
>> the cost of the baseline plans that the CBO will pick.
>>
>> Maria wrote a nice article about it [1] in 2012 which I think is still
>> relevant, but often when you have cursors with lots of baselines, SQL
>> Profiles, and patches it's time to fix the stats or change the code :)
>>
>> Andy K
>>
>> [1]
>> https://blogs.oracle.com/optimizer/post/what-is-the-difference-between-s=
ql-profiles-and-sql-plan-baselines
>>
>

--=20

Houri Mohamed

Oracle DBA-Developer-Performance & Tuning

Visit My         - Blog <http://www.hourim.wordpress.com/>

Let's Connect -
<http://fr.linkedin.com/pub/mohamed-houri/11/329/857/>*Linkedin
Profile <http://fr.linkedin.com/pub/mohamed-houri/11/329/857/>*

My Twitter <https://twitter.com/MohamedHouri>      - MohamedHouri
<https://twitter.com/MohamedHouri>

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

<div dir=3D"ltr"><p class=3D"MsoNormal" style=3D"margin:0cm 0cm 10pt;line-h=
eight:115%;font-size:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span=
 lang=3D"EN-US" style=3D"font-family:Arial,&quot;sans-serif&quot;;backgroun=
d-image:initial;background-position:initial;background-size:initial;backgro=
und-repeat:initial;background-origin:initial;background-clip:initial">Hello=
</span><span lang=3D"EN-US" style=3D"font-family:Arial,&quot;sans-serif&quo=
t;"></span></p>

<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US" s=
tyle=3D"font-family:Arial,&quot;sans-serif&quot;">=C2=A0</span><i style=3D"=
font-size:11pt"><span lang=3D"EN-US" style=3D"font-family:Arial,&quot;sans-=
serif&quot;;color:blue">In other words=C2=A0the sql profile or sql
patch helps to create new plans based on the embedded=C2=A0hints however=C2=
=A0<u>presence
of baseline with accepted=C2=A0+enabled flag as &#39;YES&#39; is always goi=
ng to rule
at the end</u>. Correct if my understanding is wrong here?</span></i></p><p=
 class=3D"MsoNormal" style=3D"margin:0cm 0cm 10pt;line-height:115%;font-siz=
e:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US" sty=
le=3D"font-family:Arial,&quot;sans-serif&quot;"></span></p>

<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US" s=
tyle=3D"font-family:Arial,&quot;sans-serif&quot;">=C2=A0</span><span style=
=3D"font-family:Arial,&quot;sans-serif&quot;;font-size:11pt">The underlined=
 part is incorrect</span></p>

<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US" s=
tyle=3D"font-family:Arial,&quot;sans-serif&quot;">=C2=A0</span><span style=
=3D"font-family:Arial,&quot;sans-serif&quot;;font-size:11pt">If you look at=
 the picture I designed in
this article</span></p>

<p class=3D"MsoNormal" style=3D"margin:0cm 0cm 10pt;line-height:115%;font-s=
ize:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US" s=
tyle=3D"font-family:Arial,&quot;sans-serif&quot;">=C2=A0</span><a href=3D"h=
ttps://hourim.wordpress.com/2015/10/01/oracle-optimizer-and-spm-plan-intera=
ction/" style=3D"font-family:Arial,&quot;sans-serif&quot;;font-size:11pt;co=
lor:blue">https://hourim.wordpress.com/2015/10/01/oracle-optimizer-and-spm-=
plan-interaction/</a></p>

<p class=3D"MsoNormal" style=3D"line-height:17.35pt;margin:0cm 0cm 10pt;fon=
t-size:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US=
" style=3D"font-family:Arial,&quot;sans-serif&quot;">You
will realize that the presence of an SPM has=C2=A0<u>no influence on the
ordinary work of the CBO</u>. Initially, Oracle will produce its execution =
plan
ignoring the presence or absence of an SPM.<br><span style=3D"font-size:11p=
t"><br></span></span></p><p class=3D"MsoNormal" style=3D"line-height:17.35p=
t;margin:0cm 0cm 10pt;font-size:11pt;font-family:Calibri,&quot;sans-serif&q=
uot;"><span lang=3D"EN-US" style=3D"font-family:Arial,&quot;sans-serif&quot=
;"><span style=3D"font-size:11pt">When generating this execution plan, all =
things being equal, Oracle will use
the set of hints contained in the SQL Profile or the SQL patch.<b><u>=C2=A0=
</u></b></span><b><u><span style=3D"font-size:11pt">It is
only when the execution plan has been generated that</span><span style=3D"f=
ont-size:11pt">=C2=A0the SPM finally
comes into play.</span></u></b><br></span></p>

<p class=3D"MsoNormal" style=3D"line-height:17.35pt;margin:0cm 0cm 10pt;fon=
t-size:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US=
" style=3D"font-family:Arial,&quot;sans-serif&quot;">And
what exactly will this SPM do?</span></p>

<p class=3D"MsoNormal" style=3D"line-height:17.35pt;margin:0cm 0cm 10pt;fon=
t-size:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US=
" style=3D"font-family:Arial,&quot;sans-serif&quot;">It
will simply ensure that only the execution plan contained in the SPM baseli=
ne
will be used regardless of how this plan has been generated, via SQL Profil=
e, via
SQL patch, or without any of those two features.</span></p>

<p class=3D"MsoNormal" style=3D"line-height:17.35pt;margin:0cm 0cm 10pt;fon=
t-size:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US=
" style=3D"font-family:Arial,&quot;sans-serif&quot;">Of
course, this insurance against a bad surprise(a non-desired execution plan)=
 is
only possible if the plan in the SPM is reproducible at the time of the
execution of the request.</span></p>

<p class=3D"MsoNormal" style=3D"line-height:17.35pt;margin:0cm 0cm 10pt;fon=
t-size:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US=
" style=3D"font-family:Arial,&quot;sans-serif&quot;">Hope
this is clear</span></p>

<p class=3D"MsoNormal" style=3D"line-height:17.35pt;margin:0cm 0cm 10pt;fon=
t-size:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US=
" style=3D"font-family:Arial,&quot;sans-serif&quot;">Best
regards</span></p>

<p class=3D"MsoNormal" style=3D"line-height:17.35pt;margin:0cm 0cm 10pt;fon=
t-size:11pt;font-family:Calibri,&quot;sans-serif&quot;"><span lang=3D"EN-US=
" style=3D"font-family:Arial,&quot;sans-serif&quot;">Mohamed
Houri</span><span style=3D"font-family:Arial,&quot;sans-serif&quot;"></span=
></p><div><span style=3D"font-family:arial,sans-serif"><font color=3D"#0000=
00"><br></font></span></div><div><span style=3D"font-family:arial,sans-seri=
f"><font color=3D"#000000"><br></font></span></div></div><br><div class=3D"=
gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Le=C2=A0ven. 17 d=C3=A9c=
. 2021 =C3=A0=C2=A005:18, Pap &lt;<a href=3D"mailto:oracle.developer35@gmai=
l.com">oracle.developer35@gmail.com</a>&gt; a =C3=A9crit=C2=A0:<br></div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-le=
ft:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">Thank you =
so much Andy.=C2=A0<div><br></div><div>If I get it correct, it&#39;s the sq=
l profile(which is generally a combination of opt_estimate hints) which ora=
cle will use to evaluate the plans but it&#39;s ultimately the sqlplan base=
lines (which must be in accepted+enabled) state which is going to be used f=
inally.=C2=A0</div><div><br></div><div>And in scenarios where we use techni=
que to manually create sql profile by passing exact outline hints (but not =
with opt_etsimate hints) i.e. using procedure=C2=A0<span style=3D"color:rgb=
(0,0,0);font-family:monospace">d</span><span style=3D"color:rgb(0,0,0)"><fo=
nt face=3D"arial, sans-serif">bms_sqltune.import_sql_profile where we have =
ability to pass the exact full query outline hints which restricts the exec=
ution path to one. In those cases it will mostly fix the exact one executio=
n path for the query no matter how many times it parses. And in the presenc=
e of such a sql profile , if the sql plan baseline has exactly the same pat=
h enabled+accepted that is going to be used or else it&#39;s going to be co=
mpletely=C2=A0discarded=C2=A0and the priority will be given to the baseline=
 which is in accepted+enabled state. (And the=C2=A0discarded plan i.e the p=
arsed plan using sql profile may be added a new baseline to the list with a=
ccepted flag as NO).=C2=A0 =C2=A0Which means sql plan baseline having enabl=
ed+accepted flag as &quot;YES&quot; will take the precedence=C2=A0always ir=
respective of sql profile/sq patch etc. Is this understanding correct?=C2=
=A0</font></span></div><div><span style=3D"color:rgb(0,0,0);font-family:ari=
al,sans-serif">Or=C2=A0</span></div><div><font color=3D"#000000" face=3D"ar=
ial, sans-serif">In other words=C2=A0the sql profile or sql patch helps to =
create new plans based on the embedded=C2=A0hints however presence of basel=
ine with accepted=C2=A0+enabled flag as &#39;YES&#39; is always going to ru=
le at the end. Correct if my understanding is wrong here?</font></div></div=
><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fr=
i, Dec 17, 2021 at 1:53 AM Andy Klock &lt;<a href=3D"mailto:andy@klockmail.=
com" target=3D"_blank">andy@klockmail.com</a>&gt; wrote:<br></div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px =
solid rgb(204,204,204);padding-left:1ex"><div>Hi Laurentiu,</div><div><div>=
</div><div></div></div><div><br></div><div><div>=E2=80=90=E2=80=90=E2=80=90=
=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Message =E2=80=90=E2=80=90=E2=
=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90<br></div><div>On Thursday, Decem=
ber 16th, 2021 at 3:08 PM, Pap &lt;<a href=3D"mailto:oracle.developer35@gma=
il.com" target=3D"_blank">oracle.developer35@gmail.com</a>&gt; wrote:<br></=
div></div><blockquote type=3D"cite"><div dir=3D"auto"><div dir=3D"auto"><di=
v>So in cases where the SQL profile or SQL patch has some hints (say FTS on=
 tab1) which is exactly opposite  than that of the one in SQL plan baseline=
(say index access for tab1). In that scenario will oracle follow profile/pa=
tch or the baseline path?<br></div></div></div></blockquote><div><br></div>=
<div>If a cursor has &quot;accepted&quot; baselines, then that is typically=
 what the CBO is going to prefer.=C2=A0 When there are multiple accepted pl=
ans, then the CBO will pick the plan with the lowest cost. For cursors that=
 also have a SQL Profile, then those hints and opt_estimates are applied wh=
ich may affect the cost of the baseline plans that the CBO will pick.<br></=
div><div><br></div><div>Maria wrote a nice article about it [1] in 2012 whi=
ch I think is still relevant, but often when you have cursors with lots of =
baselines, SQL Profiles, and patches it&#39;s time to fix the stats or chan=
ge the code :)=C2=A0<br></div><div><br></div><div>Andy K=C2=A0<br></div><di=
v><br></div><div>[1]=C2=A0<a href=3D"https://blogs.oracle.com/optimizer/pos=
t/what-is-the-difference-between-sql-profiles-and-sql-plan-baselines" targe=
t=3D"_blank">https://blogs.oracle.com/optimizer/post/what-is-the-difference=
-between-sql-profiles-and-sql-plan-baselines</a><br></div></blockquote></di=
v>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature"><div dir=3D"ltr"><div dir=3D"ltr"><p style=3D"ma=
rgin:0cm 0cm 0.0001pt"><span style=3D"font-size:10pt;font-family:Arial,sans=
-serif">Houri Mohamed=C2=A0</span></p><p style=3D"margin:0cm 0cm 0.0001pt">=
<span style=3D"font-size:10pt;font-family:Arial,sans-serif">Oracle
DBA-Developer-Performance &amp; Tuning=C2=A0</span></p><p style=3D"margin:0=
cm 0cm 0.0001pt">



</p><p style=3D"margin:0cm 0cm 0.0001pt"><span style=3D"font-size:10pt;font=
-family:Arial,sans-serif">Visit My =C2=A0 =C2=A0 =C2=A0
=C2=A0 -=C2=A0<a href=3D"http://www.hourim.wordpress.com/" target=3D"_blank=
">Blog</a></span></p><p style=3D"margin:0cm 0cm 0.0001pt"><span style=3D"fo=
nt-size:10pt;font-family:Arial,sans-serif">Let&#39;s
Connect -<a href=3D"http://fr.linkedin.com/pub/mohamed-houri/11/329/857/" t=
arget=3D"_blank">=C2=A0</a><u><a href=3D"http://fr.linkedin.com/pub/mohamed=
-houri/11/329/857/" target=3D"_blank">Linkedin
Profile</a></u></span></p><p style=3D"margin:0cm 0cm 0.0001pt">



</p><p style=3D"margin:0cm 0cm 0.0001pt"><span style=3D"font-size:10pt;font=
-family:Arial,sans-serif">My=C2=A0<a href=3D"https://twitter.com/MohamedHou=
ri" target=3D"_blank"><span style=3D"color:windowtext">Twitter</span></a>=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -<span>=C2=A0</span><a href=3D"https://twitt=
er.com/MohamedHouri" target=3D"_blank">MohamedHouri</a></span></p><p style=
=3D"margin-bottom:0.0001pt"><span style=3D"font-size:10pt;font-family:Arial=
,&quot;sans-serif&quot;"></span></p></div></div></div>

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


