Subject Re: query join issue
Author lance8086
--- In firebird-support@yahoogroups.com, "Arno Brinkman"
<firebird@a...> wrote:
> Hi,
>
>
> > FB (1.5.2) seems to have a problem with this query join
structure.
> > If I run it in MS SQL, it returns about 750 records in just a few
> > seconds which is reasonable and expected for the data. If I run
it
> > against the same data loaded into Firebird, it goes nuts. Tested
it
> > in
> > IBAccess and it kept counting to well over 200K before I canceled
it.
> >
> > select S1.userid, S1.groupid, S.username
> > from S
> > inner join S S1 on
> > S1.userid=S.userid
> > where S.groupid='004'
>
> is S.groupid also indexed?

The primary key is (groupid,userid).

> Beside that, show us the PLAN reported by the engine and we can
tell more.

This is from the IBACCESS plan tab:

PLAN JOIN (S NATURAL,S1 INDEX (PRIMARYKEY_149))

Thanks.