Subject | Re: [firebird-support] Index/query opt? |
---|---|
Author | Kjell Rilbe |
Post date | 2011-02-07T11:07:06Z |
Oh, sorry, a little quick on the editing there. F1 and F2 are aliases
for the same table F.
Kjell
Kjell Rilbe skriver:
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64
for the same table F.
Kjell
Kjell Rilbe skriver:
>--
>
> 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@... <mailto:kjell%40datadia.se>
> Telefon: 08-761 06 55
> Mobil: 0733-44 24 64
>
>
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64