Subject | Index/query opt? |
---|---|
Author | Kjell Rilbe |
Post date | 2011-02-07T11:04:48Z |
Hi,
Is ther any index you'd recommend me to try to get F2 to use and index
plan rather than natural scan? The SQL is generated from an OO
framework, so reconstructing the query is not an option.
I will change the system to do this in a completely different way later.
The index I'm after is just a "quick fix" in the meantime.
select F2.ECO_ID
from F2
where exists (
select F1.ECO_ID
from F1
where F1.ECO_ID = 3504
and F2.TELNR = F1.TELNR
)
PLAN (F1 INDEX (IX_PK_Företag))
PLAN (F2 NATURAL)
Btw, index on TELNR doesn't help.
Regards,
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
Is ther any index you'd recommend me to try to get F2 to use and index
plan rather than natural scan? The SQL is generated from an OO
framework, so reconstructing the query is not an option.
I will change the system to do this in a completely different way later.
The index I'm after is just a "quick fix" in the meantime.
select F2.ECO_ID
from F2
where exists (
select F1.ECO_ID
from F1
where F1.ECO_ID = 3504
and F2.TELNR = F1.TELNR
)
PLAN (F1 INDEX (IX_PK_Företag))
PLAN (F2 NATURAL)
Btw, index on TELNR doesn't help.
Regards,
Kjell
--
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64