Subject Query optimization help
Author Kjell Rilbe
I want tu run this query

select ...
from F
left join A on F.ORGNR = A.ORGNR
where F.FTGSTAT in ('1', '2')
and F.UTSKSTAT = '1'
and (
A.CFAR is null
or (
A.AESTAT in ('1', '2')
and A.UTSKSTAT = '1'
and A.AETYP = '1'
)
)

I get this plan:

PLAN JOIN (F NATURAL,A INDEX (ArbetsstallenFK))

I've tried adding indices on F with every combination & permutation of
the columns ORGNR, FTGSTAT, UTSKSTAT but I still get this same plan.

Any suggestions how to get rid of that "NATURAL"?

Also, is the "NATURAL" a problem re. query performance in this case or
shouldn't I bother?

Thanks,
Kjell
--
--------------------------------------
Kjell Rilbe
Adressmarknaden AM AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64