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: Full table scan

Re: Full table scan

From: Justin Cave <jcave_at_cableone.net>
Date: Tue, 04 Feb 2003 21:53:44 -0800
Message-ID: <F001.00543F53.20030204215344@fatcity.com>


At 09:08 PM 2/4/2003, you wrote:

>I'm doing a select from 2 tables joining them using a primary key- ref
>key on the tables and the explain plan is showing 2 full table scans...
>Even after analyzing the tables and the Optimizer mode is set to CHOOSE.
>
>SELECT a.col1, b.col2
> FROM table1 a, table2 b
> WHERE a.col1 = b.col1

Unless you have an index on (table2.col1, table2.col2), Oracle is going to have to go to table b for col2. Assuming that most rows in table2 will be involved in the results of the join, it's cheaper for Oracle to do a FTS on table2 than to do the join using only the PK indexes and then look up the value of col2 in the table.

Justin Cave
Distributed Database Consulting

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Justin Cave
  INET: jcave_at_cableone.net

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Feb 04 2003 - 23:53:44 CST

Original text of this message

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