Subject Re: [firebird-support] SQL - performance
Author Helen Borrie
David,

At 11:29 PM 20/08/2004 -0500, you wrote:
>Just looking at the query, both will be very poor performers. Both will
>require the SQL engine to evaluate the columns for every row in the
>table by brute force.

This isn't so. The Firebird optimizer will convert the first query:

select * from planoconta where nivel like '01.01%'

to this:

select * from planoconta where nivel STARTING WITH '01.01'

and will use an index on nivel, if there is one.

The second query has an expression for its search operand, ruling out use
of the index (for now...expression indices are coming...but the expression
index would have to exist).

./heLen