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 732265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:07:18+00:00 2026-05-14T07:07:18+00:00

I am comparing queries my development and production database. They are both Oracle 9i,

  • 0

I am comparing queries my development and production database.

They are both Oracle 9i, but almost every single query has a completely different execution plan depending on the database.

All tables/indexes are the same, but the dev database has about 1/10th the rows for each table.

On production, the query execution plan it picks for most queries is different from development, and the cost is somtimes 1000x higher. Queries on production also seem to be not using the correct indexes for queries in some cases (full table access).

I have ran dbms_utility.analyze schema on both databases recently as well in the hopes the CBO would figure something out.

Is there some other underlying oracle configuration that could be causing this?

I am a developer mostly so this kind of DBA analysis is fairly confusing at first..

  • 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-14T07:07:18+00:00Added an answer on May 14, 2026 at 7:07 am

    1) The first thing I would check is if the database parameters are equivalent across Prod and Dev. If one of the parameters that affects the decisions of the Cost Based Optimizer is different then all bets are off. You can see the parameter in v$parameter view;

    2) Having up to date object statistics is great but keep in mind the large difference you pointed out – Dev has 10% of the rows of Prod. This rowcount is factored into how the CBO decides the best way to execute a query. Given the large difference in row counts I would not expect plans to be the same.

    Depending on the circumstance the optimizer may choose to Full Table Scan a table with 20,000 rows (Dev)where it may decide an index is lower cost on the table that has 200,000 rows (Prod). (Numbers just for demonstration, the CBO uses costing algorighms for determining what to FTS and what to Index scan, not absolute values).

    3) System statistics also factor into the explain plans. This is a set of statistics that represent CPU and disk i/o characteristics. If your hardware on both systems is different then I would expect your System Statistics to be different and this can affect the plans. Some good discussion from Jonathan Lewis here
    You can view system stats via the sys.aux_stats$ view.

    Now I’m not sure why different plans are a bad thing for you… if stats are up to date and parameters set correctly you should be getting decent performance from either system no matter what the difference in size…

    but it is possible to export statistics from your Prod system and load them into your Dev system. This make your Prod statistics available to your Dev database.

    Check the Oracle documentation for the DBMS_STATS package, specifically the EXPORT_SCHEMA_STATS, EXPORT_SYSTEM_STATS, IMPORT_SCHEMA_STATS, IMPORT_SYSTEM_STATS procedures. Keep in mind you may need to disable the 10pm nightly statistics jobs on 10g/11g… or you can investigate Locking statistics after import so they are not updated by nightly jobs.

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

Sidebar

Related Questions

I am comparing two almost identical folders which include hidden .svn folders which should
Oracle SQL can do hierarchical queries since v2, using their proprietary CONNECT BY syntax.
How would you go about proving that two queries are functionally equivalent, eg they
Comparing string in C# is pretty simple. In fact there are several ways to
Comparing LinkedLists and Arrays while also comparing their differences with sorted and unsorted data
When comparing an HTTP GET to an HTTP POST, what are the differences from
When comparing two strings in c# for equality, what is the difference between InvariantCulture
I'm comparing between two techniques to create partitioned tables in SQL 2005. Use partitioned
Possible Duplicate: Reference: Comparing PHP's print and echo Is there any major and fundamental
I have trouble comparing 2 double in Excel VBA suppose that I have the

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.