Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Basic Query - Index Skip Scan

AshishRoyJul 14 2009 — edited Jul 14 2009
Hi ,

I have a very basic Query .

I am using Autotrace to check the Plan for the following Query

Table Definition :
------------------------------------
create table tb_emp(
sextype varchar2(1),
empid number
);

Table Values
-----------------------------------------------
insert into tb_emp values('F',98);
insert into tb_emp values('F',100);
insert into tb_emp values('F',102);
insert into tb_emp values('F',104);
insert into tb_emp values('M',101);
insert into tb_emp values('M',103);
insert into tb_emp values('M',105);
commit;

Index:
-----------------------------------------------------------------------------
create index EMP_SEXTYPE_EMP_IDX on tb_emp(SEXTYPE,empid);


Query:
--------------------------------------------------------------------------------------------------------------
select * from tb_emp where empid=101;

---------------------------------------------------------------------------------------------------------------
Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=0 Card=1 Bytes=15)
1 0 INDEX (FULL SCAN) OF 'EMP_SEXTYPE_EMP_IDX' (INDEX) (Cost=0 Card=1 Bytes=15)

As per b14211 this should result in a Skip index Scan ,

Any pointer to what am i missing or the other parameters that might be impacting the execution plan .
Thanks and Regards,
Ashish .
This post has been answered by Karthick2003 on Jul 14 2009
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 11 2009
Added on Jul 14 2009
4 comments
816 views