Re: query performance following 12c upgrade

  • From: Mark Burgess <mark@xxxxxxxxxxxxxxxxxxxxxxxxx>
  • To: xiang_rao@xxxxxxxxxxx
  • Date: Thu, 24 Sep 2015 10:44:47 +1000

Take a look at the optimizer_adaptive_features and optimizer_dynamic_sampling
parameters to limit this type of behaviour in 12.1.0.2. It may be an option to
consider if your SQL workload is fairly consistent and non-repetitive - ie more
“OLTP” in nature.

We have one customer running with the following values in production for their
“OLTP” databases and the behaviour has been good to date:

optimizer_adpative_features=FALSE
optimizer_dynamic_sampling=0

If possible you could implement these settings via ‘alter session’ trigger so
you don’t need to set them instance wide.

Regards,

Mark



On 24 Sep 2015, at 1:23 am, Xiang Rao <xiang_rao@xxxxxxxxxxx> wrote:

We experienced some performance degradations on some databases requiring high
traffic and low latency after upgraded to 12c. It turned out the cause was
12c adaptive plans, which spent some time to collect statistics and trying
different routes. In addition to the cost of statistics collection and trying
different plans, the final plans on some queries were not good, too. The
option "ADAPTIVE" with dbms_xplan.display_cursor will show the additional
steps used by adaptive plans.

From: jonathan@xxxxxxxxxxxxxxxxxx <mailto:jonathan@xxxxxxxxxxxxxxxxxx>
To: contact@xxxxxxxx <mailto:contact@xxxxxxxx>; sjb1970@xxxxxxxxx
<mailto:sjb1970@xxxxxxxxx>
CC: oracle-l@xxxxxxxxxxxxx <mailto:oracle-l@xxxxxxxxxxxxx>
Subject: RE: query performance following 12c upgrade
Date: Wed, 23 Sep 2015 14:57:03 +0000


Competition for the result cache sounds viable - though 12 seconds seems a
little extreme.
If the OP can't get at trace file easily, or query own v$session_event or
V$active_session_history then testing 12c after executing

alter session set "_optimizer_ads_use_result_cache" = FALSE;

might be an indicator - it should disable the use of the result cache for
dynamic stats activity.



Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
@jloracle

________________________________________
From: oracle-l-bounce@xxxxxxxxxxxxx [oracle-l-bounce@xxxxxxxxxxxxx] on
behalf of Stefan Koehler [contact@xxxxxxxx]
Sent: 23 September 2015 15:13
To: sjb1970@xxxxxxxxx
Cc: ORACLE-L
Subject: Re: query performance following 12c upgrade

Hi Steve,
thanks for the requested data.

The execution plan (especially the important predicate section) and the
amount of work is identical - expect the ROWID BATCHED part, but there is an
important hint with OPTIMIZER_FEATURES_ENABLE = 12.1.0.2.

--------------8<----------------
Note
-----
- dynamic statistics used: dynamic sampling (level=2)
- 1 Sql Plan Directive used for this statement
--------------8<----------------

Is it possible that the query is suffered by latches? How long does the
parse itself take? SPDs are based on the result cache and this can have
nasty
side effects. You can verify this by running a SQL trace on the slow SQL as
previously suggested.

By the way here are some good references about the result cache and SPD:
-
http://berxblog.blogspot.de/2015/06/sql-plan-directives-and-result-cache.html
- https://dban00b.wordpress.com/2015/04/21/311/

Best Regards
Stefan Koehler

Freelance Oracle performance consultant and researcher
Homepage: http://www.soocs.de
Twitter: @OracleSK

Steve Bradshaw <sjb1970@xxxxxxxxx> hat am 23. September 2015 um 15:53
geschrieben:

Hi,

Please see the attached. opti12 is the results when run with
optimizer_featured_enable=12.1.0.2, and opti11 it is 11.2.0.3

I've had to anonymyse the data/columns/tables etc so the formatting may
be a little out.

Thanks
Steve
--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l



Other related posts: