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

  • SEARCH
  • Home
  • 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 8262307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:43:05+00:00 2026-06-08T03:43:05+00:00

I know Oracle sometimes judges that it’s better to perform full table scan as

  • 0

I know Oracle sometimes “judges” that it’s better to perform full table scan as oppose to index scan, however still being in a “learning stage”, I’m just trying to get a better understanding of “when” oracle will determine the best route. For example, I have simple query:

Select *
  FROM GLMV_JOURNAL_LOGS JLOG 
       INNER JOIN GLMV_Transact_Details TDTL 
          ON TDTL.TR_REF_NO = JLOG.TR_REF_NO 
         AND TDTL.SCAT_KEY = JLOG.Scat_key 
         AND TDTL.CASE_KEY = JLOG.CASE_KEY 
         AND TDTL.TR_CD = JLOG.TR_CD 
       INNER JOIN FUND_DESC FDDC 
          ON FDDC.FD_DESC_ID = TDTL.FD_DESC_ID  
       INNER JOIN FD_RATES FDRT 
          ON  FDRT.FDRT_KEY = TDTL.FDRT_KEY
       INNER JOIN BEN_TYPES BNTP 
          ON BNTP.BNTP_KEY = FDRT.BNTP_KEY 
 WHERE JLOG.JRNL_CD  = '0' 
   AND JLOG.SRC_CD = '2' 
   AND JLOG.MKEY_FD_NUM <> 0 
   AND NVL(JLOG.TMOV_KEY, -1) > 0 
   AND NVL(JLOG.ORIG_SCAT_KEY, 1) = 1 
   AND TDTL.STAT_CD <> '4' 
   AND NVL(TDTL.ORIG_SCAT_KEY, 1) = 1 

The join on FD_RATES is joining on PK value, which I also created a corresponding index on GLMV_Transact_Details in thinking that a full table scan would be prevented, however, based on the explain plan below, it’s not, even after I’ve performed index rebuild and gather table stats, the outcome is still the same:

Explain Plan

Now if I go into my query and add the following where clause:

AND  FDRT.FDRT_KEY = 100

The index will kick in of course, but I guess I’m curious as to why it’s not when doing an inner join…. any tips??

  • 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-06-08T03:43:07+00:00Added an answer on June 8, 2026 at 3:43 am

    The optimizer has estimated the cost of the full table scan on FD_RATES as 106. The join this feeds into has an estimated cardinality of 416, as does the other row source feeding that join. If we were to replace the hash join with a nested loop, doing a unique index (PK) lookup for each row, the cost would be at least 1, probably 2 or 3, for each iteration of the loop, and we think there will be 416 iterations, so that would be a cost of at least 416, probably double or triple that, which is much more than the estimated cost of doing the full table scan.

    Now, the estimates could be wrong. The main thing to look at, in my experience, is the cardinalities shown in the plan. If these are reasonably accurate, then there’s a good chance that Oracle has picked reasonably efficient join order and access paths — not necessarily the most efficient, but close.

    If you want to try to force an index scan to see how it performs, I believe the hint you want would be:

    Select /*+ INDEX(fdrt) */ *
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know if oracle uses index when user queries data from table
I know that in Oracle I can get the generated id (or any other
I came to know that aqualogic service bus is renamed to oracle service bus
Possible Duplicate: Rename Oracle Table or View I know you can use ALTER TABLE
In Oracle, this returns 03/01/2010. That does not make sense to me. Anybody know
When writing a row-level trigger in Oracle, I know that you can use the
I know that Oracle is a generally good database engine but I think it
When analysing Oracle tkprof trace files I have noticed that there is sometimes a
I know that Oracle has the TRIM function and I would like to use
One of the pitfalls in Oracle is the fact that sometimes you can select

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.