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

Home -> Community -> Usenet -> c.d.o.server -> Re: performance problems with hierarchical query and outer join

Re: performance problems with hierarchical query and outer join

From: Cris Carampa <cris119_at_operamail.com>
Date: Mon, 27 Mar 2006 11:00:22 +0200
Message-ID: <4427a9cf$0$29098$5fc30a8@news.tiscali.it>


Mladen Gogala wrote:

> May be, if you could put tables FRN and MOV in a cluster and cluster
> them on all_cod column?

Thank you Mladen for your response, unfortutately the problem seem to be related to the fact that the CONNECT BY contains an OR.

Actually, I could modify my data in a way that would avoid the outer join at all:

select

   *
from

   mov0
start with

   %${some-start-condition}
connect by
(

   ( mov0.all_cod = prior mov0.all_cod and mov0.zona_destinazione_id = prior mov0.zona_provenienza_id and mov0.box_destinazione_id = prior

mov0.box_provenienza_id and mov0.fase_destinazione_dat_dal = prior 
mov0.fase_provenienza_dat_dal and mov0.movimento_data <= prior 
mov0.movimento_data )

or

   ( mov0.lotto_uscita_id = prior mov0.lotto_entrata_id ) )

I tried to create two new indexes on MOV0, one on LOTTO_USCITA_ID and one on LOTTO_ENTRATA_ID. I gathered statistics on the two new indexes and re-gathered statistics on the previous indexes and on the MOV0 table.

Here's the plan table of this query:

Plan Table


| Operation                 |  Name              |  Rows | Bytes|  Cost
------------------------------------------------------------------------
| SELECT STATEMENT          |                    |    41K|    3M|     86
|  CONNECT BY WITHOUT FILTER|                    |       |      |
|   TABLE ACCESS FULL       |MOV0                |    41K|    3M|     86
------------------------------------------------------------------------

If I comment out either one of the CONNECT BY clauses the query is fast, but with the two clauses together the performance is awful.

Any suggestion? Kind regards,

-- 
Cris Carampa (spamto:cris119_at_operamail.com)

potevo chiedere come si chiama il vostro cane
il mio รจ un po' di tempo che si chiama Libero
Received on Mon Mar 27 2006 - 03:00:22 CST

Original text of this message

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