Re: buffer advisor

From: Seth Miller <sethmiller.sm_at_gmail.com>
Date: Wed, 10 Sep 2014 11:48:04 -0500
Message-ID: <CAEueRAUfJOs9+-oQOx0k3SUbzyx7zdWYaQ3_pMN9fEYx+7Lmog_at_mail.gmail.com>



I agree with Mark on this one (which Mark am I agreeing with?). You may get a superior plan using literals but at the cost of a highly volatile library cache and lots of hard parsing. 11.2 addresses most of the issues that would cause one to set cursor_sharing to exact and use literals instead of bind variables for highly skewed data.

When using cursor sharing set to similar or force so that literals are converted to bind variables, it doesn't mean that the optimizer is running completely bind. Bind peaking will help, but only during the hard parse. After the hard parse, adaptive cursor sharing can make a world of difference by marking the cursor as bind sensitive/aware, thereby generating child cursors when the value of the bind variable demands it and at the same time continuing to soft parse.

Seth Miller

On Wed, Sep 10, 2014 at 11:24 AM, Powell, Mark <mark.powell2_at_hp.com> wrote:

>
>
> And sometimes you do not. The question becomes would automatically
> converting constants to bind variables in all cases be more beneficial to
> the overall system verse flooding the shared pool with un-sharable SQL? In
> the case where the code runs better with a constant then there are Outlines
> and SQL Profiles to assist with tuning. Then again if Oracle works this
> way bind variable peeking might just peek on every execution for statements
> where it might make a difference.
>
>
>
>
>
> *From:* Mark W. Farnham [mailto:mwf_at_rsiz.com]
> *Sent:* Wednesday, September 10, 2014 11:19 AM
> *To:* Powell, Mark; 'ORACLE-L'
> *Subject:* RE: buffer advisor
>
>
>
> Because sometimes you get a superior plan with a literal (by a lot), and
> then we’d have to hint one way or the other and we cannot do that because
> sometimes (often) we do not control the source code.
>
>
>
> *From:* oracle-l-bounce_at_freelists.org [
> mailto:oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org>] *On
> Behalf Of *Powell, Mark
> *Sent:* Wednesday, September 10, 2014 11:03 AM
> *To:* 'ORACLE-L'
> *Subject:* RE: buffer advisor
>
>
>
> Why not automatically convert all constants to bind variables as part of
> the parse? This would make nearly identical SQL statements where only the
> value of the constant changes into identical statements supporting sharing.
>
>
>
>
>
> *From:* oracle-l-bounce_at_freelists.org [
> mailto:oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org>] *On
> Behalf Of *Mark W. Farnham
> *Sent:* Tuesday, September 09, 2014 11:09 PM
> *To:* Hemant-K.Chitale_at_sc.com; 'ORACLE-L'
> *Subject:* RE: buffer advisor
>
>
>
> There is no question that reusing reusable sql parses was a huge advance
> for scalability. But tossing non-reusable sql in the shared pool just puts
> extra pressure on the latches.
>
>
>
> mwf
>
>
>
> *From:* oracle-l-bounce_at_freelists.org [
> mailto:oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org>] *On
> Behalf Of *Chitale, Hemant K
> *Sent:* Tuesday, September 09, 2014 10:57 PM
> *To:* ORACLE-L
> *Subject:* RE: buffer advisor
>
>
>
> The shared pool came at the same time as database server pl/sql --- if I
> remember correctly. [there was forms pl/sql available earlier]
>
> Was there co-development or dependency ?
>
>
>
> Hemant K Chitale
>
>
>
>
>
> *From:* oracle-l-bounce_at_freelists.org [
> mailto:oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org>] *On
> Behalf Of *Mark W. Farnham
> *Sent:* Wednesday, September 10, 2014 10:48 AM
> *To:* iggy_fernandez_at_hotmail.com; jeremy.schneider_at_ardentperf.com
> *Cc:* 'Seth Miller'; 'Oracle-L Freelists'
> *Subject:* RE: buffer advisor
>
>
>
> In fact, why not parse all sqls with literals privately? It worked just
> fine in V6.
>
>
>
> mwf
>
>
>
> *From:* oracle-l-bounce_at_freelists.org [
> mailto:oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org>] *On
> Behalf Of *Iggy Fernandez
> *Sent:* Tuesday, September 09, 2014 9:25 PM
> *To:* jeremy.schneider_at_ardentperf.com
> *Cc:* Seth Miller; Oracle-L Freelists
> *Subject:* RE: buffer advisor
>
>
>
> I wish that the ORA-4031 issue could be solved permanently
> #IfWishesWereHorses
>
>
>
> Is a solution to this problem beyond the capabilities of mortals?
> #ShoutingIntoTheWind
>
>
>
> Why is it necessary for a session to die if it cannot write to the shared
> pool? Why not just do what it needs to do even if it cannot share?
> #AskingTheObvious
>
>
>
> Iggy
>
>
> This email and any attachments are confidential and may also be
> privileged. If you are not the intended recipient, please delete all copies
> and notify the sender immediately. You may wish to refer to the
> incorporation details of Standard Chartered PLC, Standard Chartered Bank
> and their subsidiaries at https://www.sc.com/en/incorporation-details.html
> .
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Sep 10 2014 - 18:48:04 CEST

Original text of this message