Re: Plan changed After creating profile

  • From: Jonathan Lewis <jlewisoracle@xxxxxxxxx>
  • To: Oracle L <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 30 Sep 2021 15:26:27 +0100

Adric,

Useful warning.

Somewhere I have a note that points out that when you have an SQL P,lan
Baseline in place the first thing the optimizer does is optimize the query
without looking at the Baseline; so if you've got a query that takes a long
time to optimize a Basline won't address that part of the problem and a
"cunning plan" is to create the Baseline that works well, then convert it
to an SQL Patch (with a couple of calls to the relevant package).

Regards
Jonathan Lewis



On Thu, 30 Sept 2021 at 14:52, Adric Norris <landstander668@xxxxxxxxx>
wrote:

Generally people seem to find SQL Plan Baslines more stable than SQL
Profiles (but I can't quantify that, I only have anecdotal evidence) - so
if you've generated a SQL Profile it might be a good idea to generate an
SQL Plan Basline after running the query, accept it and fix it, then delete
the profile.


I've seen multiple situations where the plan fixed by the baseline can't
be reproduced (within the time constraints the optimizer is faced with)
unless the profile is present and enabled. So there's a chance that the
profile will have to be left in place.

--
"In the beginning the Universe was created. This has made a lot of people
very angry and been widely regarded as a bad move." -Douglas Adams

Other related posts: