Subject Re: [firebird-support] Groupby on date
Author Arno Brinkman
Hi,

> :: Is the table growing and growing and you still want to group
> :: by month, not depending on what year it is?
>
> Actually yes year would be part of it.
>
> :: SELECT
> :: EXTRACT(MONTH FROM FieldTimeStamp),
>
> This was exactly my plan and how Im doing it now. But will Extract use an
> index? Also I might need to group by year and month in some cases where
the
> criteria might extend beyond 12 months.

No, EXTRACT will never use a index. Only direct field comparisons can use a
index, but as i said in my previous message a index on a month column will
not be that effective, unless you'll use that in the WHERE clause. The best
is a index on FieldTimeStamp and use that field in the WHERE clause.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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 Interbase and Firebird users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://80.126.130.81