Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Full table scan
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