Subject RE: [firebird-support] firebird 2,0 and index optimization
Author ibrahim bulut
Thanks Alexandre. Your information is enough for me and replied my question.


[] On Behalf Of Alexandre Benson
Sent: Wednesday, June 13, 2007 8:13 PM
Subject: Re: [firebird-support] firebird 2,0 and index optimization

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.


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
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil

__________ NOD32 2328 (20070613) Information __________

This message was checked by NOD32 antivirus system.

[Non-text portions of this message have been removed]