Subject Re: nested select
Author Ali Gökçen
Hi,

two or five times faster nested select doesn't help you.
your nested table may be some thousands of result rows but what will
be when they are some millions for another firebird user or you at
the next time?
how can we check is OT.otidriga there or not in some millions
of DDD.dv_idord results list? sequetial? temporary indexed?
nested operations, recurive operations are dangerous for people who
wants high speed with low analytical.

nested queries reruns for each main row.
so we need the optimum nested operations to get speed.

use join logic,
or
use exists syntax instead of IN.

Regards.

Ali


--- In firebird-support@yahoogroups.com, "Maurizio P."
<mauriz_po@...> wrote:
>
> hi ,
> is it possible to make nested select faster ?
>
> something like this :
>
> SELECT OD.ornumord , OD.ordatord , OD.ortipord , OD.ordescli ,
> OD.oridscar , OD.orrifpal , OD.paragsoc
> FROM tordmaster OD , torddetaildetail OT
> WHERE OD.oridordi = OT.otkeymas
> AND OT.otidriga IN
> (
> SELECT DDD.dv_idord
> FROM tdettvend DDD
> where DDD.dv__key2 = 1670
> )
> GROUP BY OD.ornumord , OD.ordatord , OD.ortipord , OD.ordescli ,
> OD.oridscar , OD.orrifpal , OD.paragsoc
>
> thanks
>
> Maurizio
>
> Chiacchiera con i tuoi amici in tempo reale!
> http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
>