Subject | RE: [ib-support] Re: PLAN |
---|---|
Author | Nico Callewaert |
Post date | 2001-05-18T11:11:40Z |
I get your point now,
Thanks,
Nico
-----Oorspronkelijk bericht-----
Van: ded_spb@... [mailto:ded_spb@...]
Verzonden: donderdag 17 mei 2001 17:11
Aan: ib-support@yahoogroups.com
Onderwerp: [ib-support] Re: PLAN
Thanks,
Nico
-----Oorspronkelijk bericht-----
Van: ded_spb@... [mailto:ded_spb@...]
Verzonden: donderdag 17 mei 2001 17:11
Aan: ib-support@yahoogroups.com
Onderwerp: [ib-support] Re: PLAN
--- In ib-support@y..., "Nico Callewaert" <ncw@c...> wrote:
> For
> example if you build a JOIN, with a DISTINCT, it will not use a
index I
> guess. As far as I know DISTINCT cannot use a index ???
>
Nico, don't guess, read and try. :) Sorry for old-style SQL, you can
do the same with SQL-92.
Choice one of your 1:n pair of tables and make
Select T1.Id, T2.Id
>From T1, T2
Where T2.T1_ID=T1.ID
you'll see
Plan (T1 natural, t2 index (rdb$foreign...)
Select T1.Id, T2.Id
>From T1, T2
Where T1.ID>0
And T2.T1_ID=T1.ID
you'll see
Plan (T1 index (rdb$primary...), t2 index (rdb$foreign...)
Try the same with distinct and you'll see the same. Plan is defined
by any conditions on indexed columns. The only exception I know is
MAX, it requires descending index.
Best regards.
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/