Subject Re: [firebird-support] SELECT UPPER(MY_FIELD) -> DON'T USE INDEX
Author Martijn Tonies
Hi,

> Hello, I'm using FB 1.5
>
> I have a table with an index on MY_CHAR_FIELD
> if I do:
>
> SELECT * FROM MY_TABLE WHERE MY_CHAR_FIELD STARTING WITH 'SOMETHING'
>
> FB perform index reads, bu if I do
>
> SELECT * FROM MY_TABLE WHERE Upper(MY_CHAR_FIELD) STARTING WITH
'SOMETHING'
>
> FB don't use any index, which seems logical.
> Can I create an index based on Upper(MY_CHAR_FIELD) ?
> How is the correct way to do it ?

In Firebird 2.0 you can, but not in 1.5.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com