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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: dba_tables.num_rows is less than dba_indexes.num_rows

RE: dba_tables.num_rows is less than dba_indexes.num_rows

From: Billy Verreynne (JW) <VerreyB_at_telkom.co.za>
Date: Thu, 11 Aug 2005 11:56:50 +0200
Message-ID: <445F36B0271AE1419CEE0B9589044B433747EF@TYGRRA01-XCS00.telkom.co.za>

Lex de Haan wrote:

> I am too lazy to test it myself, but *in theory* the number
> of index entries could be used in a join situation where one
> of the participating tables is not accessed itself --
> because the index contains all necessary information -

Exactly. Works like this in practise in Oracle. E.g. when doing a SELECT COUNT on column(s) uniquely indexed, the unique index (e.g. PK) is a prime candidate to doing a full index scan (or even a parallel index scan) as the index contains an entry per row and is (usually) a significantly smaller data volume to plough through than a full table scan. (still does not beat PQ on bitmap indexes though when doing a select count).

The CBO is never stupid. Pretty weird at on occasion? Yep. But never just plain stupid. :-)

--
Billy

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This e-mail and its contents are subject to the Telkom SA Limited
e-mail legal notice available at
http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
http://www.freelists.org/webpage/oracle-l
Received on Thu Aug 11 2005 - 05:00:52 CDT

Original text of this message

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