Forum Stats

  • 3,760,355 Users
  • 2,251,692 Discussions
  • 7,871,075 Comments

Discussions

Poor performance after enabling db links

124»

Answers

  • Charles M
    Charles M Member Posts: 806 Bronze Badge
    edited Mar 6, 2018 3:27PM

    Thanks rp0428. As far as I know, it should be performing the same task (though, the ETL looks for changes to the source data, and therefore could have some variability in some areas). But, when I look at the inserts, on the warehouse-side, they look inline ... right around 234K. I can see the same for the day before and the day after.

    I'll see if I can dig up some of the last few executions and we can compare the rows.

    Regards,

    Charles

  • Charles M
    Charles M Member Posts: 806 Bronze Badge
    edited Mar 6, 2018 4:30PM
    You could have a situation where having more data pokes at the optimizer to use a better plan.  You probably need to use some kind of plan stability, taking into account the variance of input.  It's possible that removing hints allows the optimizer to properly use statistics it already knows about, but it's also possible you are setting up for a future "why did this become slow again?"You probably want to google up on adaptive cursor sharing and histograms too.

    Understood, thanks.

    I will research adaptive cursor sharing. I know that we have cursor_sharing set to 'EXACT' - this was per an OBIA performance note (not sure if that is relevant to what you are saying here ...).

    Regards,

    Charles

  • AndrewSayer
    AndrewSayer Member Posts: 12,998 Gold Crown
    edited Mar 6, 2018 6:22PM Accepted Answer
    Charles M wrote:You could have a situation where having more data pokes at the optimizer to use a better plan. You probably need to use some kind of plan stability, taking into account the variance of input. It's possible that removing hints allows the optimizer to properly use statistics it already knows about, but it's also possible you are setting up for a future "why did this become slow again?"You probably want to google up on adaptive cursor sharing and histograms too.Understood, thanks.I will research adaptive cursor sharing. I know that we have cursor_sharing set to 'EXACT' - this was per an OBIA performance note (not sure if that is relevant to what you are saying here ...).Regards,Charles

    ACS is not relevant here. ACS is all about when your bind variables can have hugely different selectivity depending on what you're passing in... you're not using bind variables here.

    Cursor_sharing exact is good, some naughty applications will shove literals into their SQLs, causing you to do hard parses constantly, this just doesn't scale in OLTP and so the recommendation is to set cursor_sharing to force so that Oracle will take care of it for you. Since this is not an OLTP scenario, and you wouldn't expect to run the same process for a good few hours after running it, the time to parse it is going to be unimportant, so you're fine with the literals.

    ACS is definitely an interesting read though.

    As I said before, the presence of the DB link meant that your hints changed their meaning (they were invalid before), this had the unexpected result of making your nested loops hint target your views rather than the tables underneath the views. As you saw, removing the hint allowed the CBO to do what it wanted to do, and I suspect removing any others would be a good idea. Of course, if the CBO doesn't come up with the right plan on it's own, we can investigate why.

  • Charles M
    Charles M Member Posts: 806 Bronze Badge
    edited Mar 7, 2018 10:30AM

    Thanks Andrew. I'm going to mark this as correct, as it sums up the primary focus of the discussion. It sounds like there is some more things I can review and possible implement, but we did address the main issue of the posting.

    Again, thanks to everyone ... we covered a lot of ground on this, and there were many helpful ideas and great links provided along the way!

    Regards,

    Charles

This discussion has been closed.