Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> hierarchical query + outer join performance problems
Hello, the following hierarchical query gives acceptable execution times:
select
rownum,
mpr.piva_produttore, mpr.lotto_spedizione_id, mpr.piva_fornitore, mpr.lotto_spedizione_id_fornitore, mpr.des_materia_prima_produttore, mpr.data_spedizione, mpr.nro_bolla,
mpr
start with
mpr.piva_produttore = :x and mpr.lotto_spedizione_id = :y and mpr.prodotto_id = :z
mpr.piva_produttore = prior mpr.piva_fornitore and mpr.lotto_spedizione_id = prior mpr.lotto_spedizione_id_fornitore and mpr.prodotto_id = prior mpr.prodotto_id_materia_prima;
SQL> @q-hq
4 rows selected.
Elapsed: 00:00:00.01
Unfortunately I need to pick up some data from table LOT, who must outer-joined with table MPR. If I do that, the performance decreases dramatically:
select
rownum,
mpr.piva_produttore, mpr.lotto_spedizione_id, lot.caz_id, mpr.piva_fornitore, mpr.lotto_spedizione_id_fornitore,
lot,
mpr
where
SQL> @q3
4 rows selected.
Elapsed: 00:00:10.31
Here's the query plan:
How can I avoid the FTS on MPR? I tried to create an index on the joined columns but the optimizer seem to ignore it.
I'm using Oracle 9.0.1 on Linux.
Thanks in advance. Kind regards,
-- Cris Carampa (cris119_at_operamail.com) "E` evidente che siamo di fronte allo sfruttamento opportunistico di quella quota di astensioni fatalmente derivanti da disinteresse o indifferenza." (Gustavo Zagrebelsky)Received on Wed Jul 06 2005 - 03:33:04 CDT