Subject Re: [firebird-support] firebird 2,0 and index optimization
Author Alexandre Benson Smith
ibrahim bulut wrote:
> Does firebird 2 use indexes more functionally and fast with aggregate
> functions.
>
> I use views with aggregate functions.
>
>
>
> If i have a view that uses a group by function by id and i want to read a
> record from this view,
>
> does optimizer scan all records for calculating the data and build all the
> view or optimizer scan only records that i want from it.
>
>

Ibrahim,

In FB 1.5 and prior when you have a view with aggregate the WHERE clause
used on the select on the view are transformed to a HAVING clause, so it
materializes all the result set and then filter it out.

In FB 2.0 the HAVING clause would be used only if the filter criteria is
applied to an aggregate field, if applied to a non aggregate field it's
used as a WHERE clause, and performs very fast.

see you !

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