Re: Priority of profile baseline patch

  • From: Laurentiu Oprea <laurentiu.oprea06@xxxxxxxxx>
  • To: Pap <oracle.developer35@xxxxxxxxx>
  • Date: Thu, 16 Dec 2021 21:47:17 +0200

Hello Pap,

As far as I remember having a profile and a patch for the same sql_id
should not be possible, it will give you an error if you try to create one
while the other exists.

I remember I had a problem with a plan baseline that was not picked and
somehow the reason was dynamic sampling going crazy. To have a quick fix I
created a sql_patch with dynamic_hint(0) then baseline was used every time.
This might suggest that the hints in the patch were evaluated first and
then the optimizer tried to replicate the plan in the baseline.
Possibly this might be valid with sql profiles as well.

I Hope this helps.


În joi, 16 dec. 2021 la 21:27, Pap <oracle.developer35@xxxxxxxxx> a scris:

Hello listers, this question is not related to any specific version but a
general one. As we saw its allowing us to create SQL profile(with copied
outline) for same sql_id for which plan baselines already exists in both
enabled and accepted state and vice versa. So wanted to understand is there
a preference order or priority which oracle follows if we have all of the
three i.e SQL profile, SQL baseline, SQL patch created for same SQL_id? Or
it can mix up all these and results into some things unexpected plan so we
should avoid these multiple options?

Other related posts: