Subject RE: [firebird-support] Order by
Author Alan McDonald
> for First case (Records read 45)
>
> 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
>

Have you used JOIN and not left outer?
Alan