Subject | RE: [firebird-support] Order by |
---|---|
Author | Alan McDonald |
Post date | 2003-11-30T23:51:56Z |
> for First case (Records read 45)Have you used JOIN and not left outer?
>
> SQL is
> select cln.*, anm.*
> from "Client_Main" cln left outer join "Animal_Main" anm
> on anm."Owner" = cln."Ref_Number"
> where cln."FName" starting with 'SA'
>
> Plan is
> [PLAN JOIN (CLN INDEX (CLN_BY_FNAME),ANM INDEX (Anm_By_Owner))]
>
> _________________________________________________________________
> for Second case (Records read 360)
>
> SQL is
> select cln.*, anm.*
> from "Client_Main" cln left outer join "Animal_Main" anm
> on anm."Owner" = cln."Ref_Number"
> where cln."FName" starting with 'SA'
> order by cln."FName" desc
>
> Plan is [PLAN SORT (JOIN (CLN INDEX (CLN_BY_FNAME),ANM INDEX
> (Anm_By_Owner)))]
>
> Regards
>
> Sandeep
>
Alan