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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:07:08+00:00 2026-05-30T21:07:08+00:00

I am very new to Oracle exploring things,reading about how index access ,i got

  • 0

I am very new to Oracle exploring things,reading about how index access ,i got to come to a conclusion that ,suppose i have a table emp.

table emp
---------------------------
empno  ename  salary mgrid
---------------------------
1   ab  200 2
2   bn  900 3   
3   bh  900 1
4   ah  890 4   
5   kk  67  0   
6   ac  9090    

and this is how unique index on primary key empno is created

    index table(suppose)
--------------------
rowid  index value  
---------------------
xyzz       1
-          2
-          3
-          4
-          5
-          6

where ‘-‘ means some hex value ,suppose i write a query that

 select * from emp where empno ='5'

then it will take out the rowid corresponds to index value 5 and fetch the row corresponds to 5 empno from emp table

Now my doubt is that here it is fetching from index_table ,but to find rowid it is also scanning the whole table (index_table) till 5 ,and the same usses rowid to find the row,then how it is different from the table without index?,there also we are scanning the whole table till 5 empno.

only advantage is index are stored in ascending order.

i know i am wrong ,but can someone explain this

**Doubt**

Does a full table scan ,scans each and every rows column irrespective of it filter condition ?
lets take the query that i used above ,if there is no primary key on that table emp,then it will do full table scan ,then for empno=5 ,will it scan each and every row empno value or it will scan empname,salary and mrgid also?

  • 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-30T21:07:09+00:00Added an answer on May 30, 2026 at 9:07 pm

    Oracle (or any other database) is not scanning the entire index in the example you posted. And that’s the difference between a heap table and an index.

    In very broad terms, you can compare an index with a phone book. If you want to find the phone number (the rowid) of Frank Miller in Georgetown (empno=5) you take the phone book and find the entries for Georgetown. You don’t have to read the entire phone book because you know the towns are ordered. So you open the phonebook in the middle and discover the town is Montana City. Since Montana City comes after Georgetown you open the phone book between your current opening and the beginning. With this tactic you go on until you find Georgetown. Then you do the same thing with the last name and the first name.

    Again, this works because towns, last names and first names are alphabetically ordered. In the database, this is ensured with b-trees.

    You probably want to read up on b-trees for further information, for example
    on tahiti

    Edit: You also asked if the database has to scan the entire table if there is no primary key. The answer is: yes, it has to if there is no index on empno, either.

    In the phone book analogy, this would be a query like find all phone numbers whose address is 22 Elm Street. Since the phone book is not ordered by street name or house number, you have to read each entry in order to find the respective phone numbers.

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

Sidebar

Related Questions

Am very new to Oracle triggers. Suppose I have a trigger on an insert
I have a very large project that uses Oracle ODP.NET. Right now it is
Im very new to Oracle so can anyone please explain about sys and system
I'm very new to oracle but I've been learning about it in class and
I'm very new to Oracle and was wondering if there's a way either through
Very new to FluentNHibernate, but I'm also excited about the area. I've recently started
I very new to Python, and fairly new to regex. (I have no Perl
I still very new using Subversion. Is it possible to have a working copy
I am very new to creating webservers - and I have had several goes
I am VERY new to ASP.NET. I come from a VB6 / ASP (classic)

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.