Subject Re: [ib-support] Is a joined query faster than a subquery, or doesn't it matter?
Author guido.klapperich@t-online.de
Hi Jörg

I have asked the same question half a year ago in the IBO-Mailinglist. These
are the results in short words:
1) When you just do a select without an order by, it doesn't matter, if you
use a Join or a SubSelect.
2) When you select with an order by, you should use the subselect.


Guido.

Jörg Schiemann wrote:

> Hi,
>
> I've a master and a detail table like
>
> create table "SampleMaster" (
> MasterID integer not null primary key,
> OrderNo integer not null,
> Comment varchar(20),
> .
> .
> .
> );
>
> and
>
> create table "SampleDetail" (
> DetailID integer not null primary key,
> MasterID integer not null,
> OrderPos integer not null,
> quantity integer not null,
> .
> .
> .
> constraint fk_MasterID foreign key (MasterID) references SampleMaster
> (MasterID)
> );
>
> Is a query with a subquery faster then a joined query if I want all fields
> from the SampleDetail and only OrderNo from SampleMaster?
>
> TIA
>
> Jörg Schiemann
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com