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: How to tune treewalk sql statement

Re: How to tune treewalk sql statement

From: Greg Moore <sqlgreg_at_pacbell.net>
Date: Wed, 26 Sep 2001 13:19:18 -0700
Message-ID: <F001.00399E2D.20010926133211@fatcity.com>

CONNECT BY queries are self joins -- joining the table to itself. For every row, Oracle searches the table to find a match(s), then marches to the next row, searches for a match, etc.

If you don't index then for a 500 row table you march down the table row by row, and for every row you do a full table scan, resulting in 500 full table scans.

So check the columns in your SQL that follow the START WITH and CONNECT BY clauses. Indexing these columns is the first thing (and perhaps the only thing) you need to do.

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Greg Moore
  INET: sqlgreg_at_pacbell.net

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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 Wed Sep 26 2001 - 15:19:18 CDT

Original text of this message

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