Subject | Changing COLLATION from UTF8 to UNICODE_CI_AI slows down select |
---|---|
Author | Werner F. Bruhin |
Post date | 2010-11-12T16:16:08Z |
I am doing the following select:
SELECT NAME FROM CEPAGE_SYN WHERE UPPER(NAME) STARTING 'SEMILLON' ORDER
BY NAME;
PLAN (CEPAGE_SYN ORDER CEPAGE_SYN_IDX1)
Why is the above not using the index but below is?
SELECT NAME FROM CEPAGE_SYN WHERE NAME STARTING 'Semillon' ORDER BY NAME;
PLAN (CEPAGE_SYN ORDER CEPAGE_SYN_IDX1 INDEX (CEPAGE_SYN_IDX1))
With this it is using the index again:
SELECT NAME FROM CEPAGE_SYN WHERE NAME STARTING 'Semillon' collate
UNICODE_CI_AI ORDER BY NAME;
But upper/lower case of search criteria and column content have to match.
I would like to be able to search ignoring case and accent in both the
column and the search criteria.
Any hints would be very much appreciated.
Werner
SELECT NAME FROM CEPAGE_SYN WHERE UPPER(NAME) STARTING 'SEMILLON' ORDER
BY NAME;
PLAN (CEPAGE_SYN ORDER CEPAGE_SYN_IDX1)
Why is the above not using the index but below is?
SELECT NAME FROM CEPAGE_SYN WHERE NAME STARTING 'Semillon' ORDER BY NAME;
PLAN (CEPAGE_SYN ORDER CEPAGE_SYN_IDX1 INDEX (CEPAGE_SYN_IDX1))
With this it is using the index again:
SELECT NAME FROM CEPAGE_SYN WHERE NAME STARTING 'Semillon' collate
UNICODE_CI_AI ORDER BY NAME;
But upper/lower case of search criteria and column content have to match.
I would like to be able to search ignoring case and accent in both the
column and the search criteria.
Any hints would be very much appreciated.
Werner