1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Optimization Rules?

Discussion in 'SQL PL/SQL' started by reylliam, Feb 28, 2011.

  1. reylliam

    reylliam Active Member

    Likes Received:
    Trophy Points:
    Austin, TX

    I just put myself in a weird situation, and I was hoping someone could suggest something about it.

    I had a query that ran acceptably in 4:52.

    Explain plan showed: Cost- 32330, Bytes- 590, Cardinality- 5

    I then had to insert a line that used the LIKE function for string comparison on a PK field in order to obtain a subset of those values.

    The explain plan then showed: Cost- 23916, Bytes- 118, Cardinality- 1.

    However, despite all the values lowering, implying a faster run, it still hadn't completed at over 10:00.....

    Is that to be expected? Any way to improve this back? Just live with all the values and filter in Excel afterward? :)
  2. zargon

    zargon Community Moderator Forum Guru

    Likes Received:
    Trophy Points:
    Aurora, CO
    You need to either enable autotrace before you run this query or check the v$sesstat view for session-specific metrics to see why this query is now running much longer than expected. Also post the entire execution plan. Without that data no one can help you solve this problem.