Subject Re: [ib-support] (RESULTS) Re: How to improve select performance
Author Arno Brinkman
Hi,

<...snip>
> Tomislav Avramovic:
>
> select
> min(T.Data)
> from
> Turno T LEFT join
> MaquinaOcupacao MO on (MO.TurnoID = T.TurnoID)
> where
> T.Data > '2002-12-01' and
> MO.MaquinaID = 17
>
> PLAN JOIN (T INDEX (SK_TURNO_DATA),MO INDEX (RDB$FOREIGN210))
> Reads 422
> writes 31
> Execution Time 1.0035 sec
> GOOD RESULTS !!!

<snip>

> Just one thing, before I run the statment from Tomislav I thought that the
> speed will not be so good because of the left join, I am a little
impressed
> that a left join produces better results than a natural join... Any
comments ?
>
> thanks again !

In this case the LEFT JOIN force that Turno is used as "base" table and
because Turno has a less records than MaquinaOcupacao this speeds up the
query a lot.

btw Have you already run SET STATISTICS INDEX <index name> for all indices ?


Regards,
Arno Brinkman