Subject Re: [firebird-support] index on TIMESTAMP field to facilitate search on DATE
Author Arno Brinkman
Hi,

>I have a TIMESTAMP field and using a SQL like
>
> SELECT .....
> WHERE CAST(T2.CHECKIN_TIMESTAMP AS DATE) = 'NOW'
>
> If i add an index of CHECKIN_TIMESTAMP will it speed up the search?

No, but you can use this for example:

SELECT .....
WHERE
T2.CHECKIN_TIMESTAMP >= CURRENT_DATE and

T2.CHECKIN_TIMESTAMP < CURRENT_DATE + 1

which could benefit from the index.

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