Subject | Re: [firebird-support] SQL - performance |
---|---|
Author | Helen Borrie |
Post date | 2004-08-21T10:01:51Z |
David,
At 11:29 PM 20/08/2004 -0500, you wrote:
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
At 11:29 PM 20/08/2004 -0500, you wrote:
>Just looking at the query, both will be very poor performers. Both willThis isn't so. The Firebird optimizer will convert the first query:
>require the SQL engine to evaluate the columns for every row in the
>table by brute force.
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