Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: why oracle does not use pk_emp in my select?

Re: why oracle does not use pk_emp in my select?

From: DA Morgan <damorgan_at_exxesolutions.com>
Date: Wed, 26 Mar 2003 21:26:00 -0800
Message-ID: <3E828B68.5D6173A5@exxesolutions.com>


zhangguoping_at_boco.com.cn wrote:

> i exec following sql in scott/tiger:
>
> "explain plan for select empno from emp"
>
> but it shows
> --------------------------------------------------------------------
> | Id | Operation | Name | Rows | Bytes | Cost |
> --------------------------------------------------------------------
> | 0 | SELECT STATEMENT | | 82 | 1066 | 2 |
> | 1 | TABLE ACCESS FULL | EMP | 82 | 1066 | 2 |
> --------------------------------------------------------------------
> Note: cpu costing is off
>
> why doesn't it perform full index scan since pk_emp contain the empno
> needed!
> by the way, what 's meaning of "Note: cpu costing is off"?????
>
> i am a freshman, thks!

Dear freshman.

FYI: Don't ever post without the version and edition of Oracle

Most likley because your tables are so small that the cost of reading the index plus the table is higher than just reading the table itself. A table with fewer than 10,000 rows likely is a waste for an index. The number of rows will vary up or down based on many factors.

Daniel Morgan Received on Wed Mar 26 2003 - 23:26:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US