Subject | Index/Plan/View question |
---|---|
Author | Werner F. Bruhin |
Post date | 2011-11-23T11:11:52Z |
I do a query like this:
SELECT subregion.NAME
FROM subregion
WHERE subregion.name collate UNICODE_CI_AI starting with 'abona'
And I get a plan:
PLAN (SUBREGION NATURAL)
I tried with these indexes, obviously would like to end up with just one
of them):
CREATE INDEX SUBREGION_IDX1 ON SUBREGION (NAME);
CREATE INDEX SUBREGION_IDX2 ON SUBREGION COMPUTED BY (lower(NAME));
CREATE DESCENDING INDEX SUBREGION_IDX3 ON SUBREGION (NAME);
'subregion' is a table ultimately I will have a view for subregion which
brings in another table, but still like to search by name and preferably
with the use of an index.
This is with FB 2.5.
Looking for tips and/or documentation links to read for better
understanding on when indexes are used or what to do to get them used.
Werner
SELECT subregion.NAME
FROM subregion
WHERE subregion.name collate UNICODE_CI_AI starting with 'abona'
And I get a plan:
PLAN (SUBREGION NATURAL)
I tried with these indexes, obviously would like to end up with just one
of them):
CREATE INDEX SUBREGION_IDX1 ON SUBREGION (NAME);
CREATE INDEX SUBREGION_IDX2 ON SUBREGION COMPUTED BY (lower(NAME));
CREATE DESCENDING INDEX SUBREGION_IDX3 ON SUBREGION (NAME);
'subregion' is a table ultimately I will have a view for subregion which
brings in another table, but still like to search by name and preferably
with the use of an index.
This is with FB 2.5.
Looking for tips and/or documentation links to read for better
understanding on when indexes are used or what to do to get them used.
Werner