Subject Re: [firebird-support] Re: PLAN SORT
Author Alexandre Benson Smith
Adam wrote:
> --- In firebird-support@yahoogroups.com, "radevojvodic" <vrade@...> wrote:
>
>> Hi All,
>>
>> How can PLAN SORT be avoided in query. All indexes are used, no
>> natural orders , slow quary.
>>
>
> Don't use order by, group by, distinct or union.
>
> Adam
>

Or add 0 to numeric fields or concatenate '' to char fields that are
sorted, example:

Original Query:
select Name from Costumers order by Name

Let's supose the plan was
PLAN(Costumers Order(Name))


Changing the query to this:
Original Query:
select Name from Costumers order by Name || ''

Will avoid the ORDER plan.

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br