Subject | SELECT UPPER(MY_FIELD) -> DON'T USE INDEX |
---|---|
Author | Sergio H. Gonzalez |
Post date | 2008-04-22T14:44:53Z |
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 ?
Thanks!
-sergio
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 ?
Thanks!
-sergio