Continuing in the inspiration instilled into me by Dominic Brooks’ post on SQL Plan Management choices, I decided to picture the Oracle CBO behavior in presence of enabled and accepted SPM plan(s) baseline:
The right part of the picture, when triggered, demonstrates the parsing penalty you will have to pay before running your SQL query. Particularly when there are multiple accepted and enabled SPM plans the CBO has to try reproducing and costing all of them before making its final decision. The picture also shows that under all circumstances the CBO will start first by compiling its execution plan as if it is not constrained by any SPM plan. This clearly demonstrates that if your query is suffering from a hard parsing execution time (when the plan generation takes a lot of time) then SPM will not help you. This is where the mantra “When you can hint it then Baseline it” ceases to be accurate.
[…] Reminder of the baseline reproduction system […]
Pingback by Did it really fix it 2: Plan flip, unprofileable, baseline OFE round 2 and “stability” | OraStory — November 16, 2015 @ 6:31 pm |
Maybe there’s something not quite right about this diagram (or I’m not reading it properly) because if the best cost plan doesn’t match the baseline then it will get inserted into the baseline anyway (if not fixed) for future evolution/evaluation regardless of whether round 1 or round 2 are successful
Comment by Dom Brooks — November 17, 2015 @ 10:52 am |
Dom,
You are absolutely right
I will phrase the part of picture you are referring to for more clarity
Whatever the compiled CBO plan is, it should go via one of the following paths:
(1) it differs from an existing SPM plan : it will be inserted into the SPM baseline with ACCEPTED property set to NO (whether it will be used or not depends on the reproducibility of the SPM plan)
(2) it equals an existing SPM plan : it will not be inserted into the SPM baseline because it’s already there and it will be used by the query
The picture is, indeed, suggesting that the CBO plan will be inserted into the SPM baseline only if the SPM plan failed to be reproduced. Hopefully you are here to observe such kind of details. Thought that what I have in my mind was in accordance with your remark.
I will update the picture as soon as possible
Best regards
Comment by hourim — November 19, 2015 @ 10:27 am |