Subject Re: [firebird-support] Re: optimization question (select)
Author Arno Brinkman
Hi,

> WHERE
> x.FieldA > 1 and x.FieldA < 10000000 and
> x.FieldB > 5 and x.FieldB < 6
> PLAN (Tablex INDEX (FieldA))
>
> execution time: 7.44 Seconds

> WHERE
> x.FieldA > 1 and x.FieldA < 10000000 and
> x.FieldB > 5 and x.FieldB < 6
> PLAN (Tablex INDEX (FieldA, FiledB))
>
> execution time: 500 ms

> WHERE
> x.FieldA > 1 and x.FieldA < 10000000 and
> x.FieldB > 5 and x.FieldB < 6
> PLAN (Tablex INDEX (FieldB))
>
> execution time: 0 ms (of course, because the restriction is on field B in this sample)

What with a index on (FieldA, FieldB) and a Index on (FieldB) ?
I understood you need (FieldA, FieldB) for order by optimization.
Which pagesize are you using?

I don't think there is a lot difference between version 2.1.2 and 2.1.3 in the optimizer.

Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

General database development support:
http://www.databasedevelopmentforum.com

Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Firebird and Interbase users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info