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.





_____

From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of Alexandre Benson
Smith
Sent: Wednesday, June 13, 2007 8:13 PM
To: firebird-support@yahoogroups.com
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.
>
>

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



__________ NOD32 2328 (20070613) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



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