Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 192159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:24:09+00:00 2026-05-11T16:24:09+00:00

Are there any good ways to objectively measure a query’s performance in Oracle 10g?

  • 0

Are there any good ways to objectively measure a query’s performance in Oracle 10g? There’s one particular query that I’ve been tuning for a few days. I’ve gotten a version that seems to be running faster (at least based on my initial tests), but the EXPLAIN cost is roughly the same.

  1. How likely is it that the EXPLAIN cost is missing something?
  2. Are there any particular situations where the EXPLAIN cost is disproportionately different from the query’s actual performance?
  3. I used the first_rows hint on this query. Does this have an impact?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:24:09+00:00Added an answer on May 11, 2026 at 4:24 pm

    How likely is it that the EXPLAIN cost is missing something?

    Very unlikely. In fact, it would be a level 1 bug 🙂

    Actually, if your statistics have changed significantly from the time you ran the EXPLAIN, the actual query plan will differ. But as soom as the query is compliled, the plan will remain the same.

    Note EXPLAIN PLAN may show you things that are likely to happen but may never happen in an actual query.

    Like, if you run an EXPLAIN PLAN on a hierarchical query:

    SELECT  *
    FROM    table
    START WITH
            id = :startid
    CONNECT BY
            parent = PRIOR id
    

    with indexes on both id and parent, you will see an extra FULL TABLE SCAN which most probably will not happen in real life.

    Use STORED OUTLINE‘s to store and reuse the plan no matter what.

    Are there any particular situations where the EXPLAIN cost is disproportionately different from the query’s actual performance?

    Yes, it happens very very often on complicate queries.

    CBO (cost based optimizer) uses calculated statistics to evaluate query time and choose optimal plan.

    If you have lots of JOIN‘s, subqueries and these kinds on things in your query, its algorithm cannot predict exactly which plan will be faster, especially when you hit memory limits.

    Here’s the particular situation you asked about: HASH JOIN, for instance, will need several passes over the probe table if the hash table will not fit into pga_aggregate_table, but as of Oracle 10g, I don’t remember this ever to be taken into account by CBO.

    That’s why I hint every query I expect to run for more than 2 seconds in a worst case.

    I used the first_rows hint on this query. Does this have an impact?

    This hint will make the optimizer to use a plan which has lower response time: it will return first rows as soon as possible, despite the overall query time being larger.

    Practically, it almost always means using NESTED LOOP‘s instead of HASH JOIN‘s.

    NESTED LOOP‘s have poorer overall performance on large datasets, but they return the first rows faster (since no hash table needs to be built).

    As for the query from your original question, see my answer here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any good resources for learning C++ that a C# user could use,
Are there any 'good' ways to cause a thread waiting on a recvfrom() call
Are there any good ways to make small haskell executables? With ghc6 a simple
C programming, are there any good ways to manage path strings rather than using
Are there any good ways to limit the number of times an application can
Are there any good ways to work with blocks of text (Strings) within Java
I was wondering if there were any good pre-built ways to implement an EAV
Are there any good tutorials that outline proven Architecture patterns for Facebooks applications? Most
Are there any good ways to define interfaces/class hierarchies in a non language specific
I wonder if there are any good / possible ways to automate - for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.