Home » RDBMS Server » Performance Tuning » Full table scan when one type of records (Oracle, Windows)
Full table scan when one type of records [message #377530] Tue, 23 December 2008 06:27 Go to next message
Messages: 5
Registered: September 2008
Junior Member
When I execute the following query in the table, the explain plan shows a full table scan.
FROM Posting_Proposal_Head_Tab.

Company field is part of the primary_key.
table holds records only on company '01'.

When I used a company which is not exist in the table(other than '01') then shows a index range scan.

Is this a bug in oracle or is this the way that the query should handle.
Re: Full table scan when one type of records [message #377538 is a reply to message #377530] Tue, 23 December 2008 06:48 Go to previous message
Michel Cadot
Messages: 64953
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Oracle is very smart.
It knows that if you use 01 then it has to return (almost) all rows so it knows it is faster to full scan.
And it knows when you use another value there is no or few rows so it uses index.
Really smart, doesn't it?

Previous Topic: Querying the database faster
Next Topic: Substr,LTrim,Rtrim making query run slow
Goto Forum:

Current Time: Sun Jun 25 19:06:19 CDT 2017

Total time taken to generate the page: 0.11826 seconds