Subject | Re: [ib-support] Case Sensitivity on Indices |
---|---|
Author | Helen Borrie |
Post date | 2003-01-14T22:31:16Z |
At 12:02 PM 14/01/2003 -1000, you wrote:
comparison be optimal?
If you have certain char or varchar columns that need a case-insensitive
search frequently, create an additional column of the same length which is
populated automatically by before insert and before update triggers and
stores your value as upper case. Index this proxy search column instead of
the actual column.
e.g.
create trigger bi_proxy_last_name for customer
active before insert position 0
as
begin
if (new.last_name is not null) then
new.proxy_last_name = upper(new.last_name);
end
create trigger bu_proxy_last_name for customer
active before update position 0
as
begin
if (new.last_name <> old.last_name
and new.last_name is not null) then
new.proxy_last_name = upper(new.last_name);
end
heLen
>Aloha Again... Thanks so much for the advice given so far. I'veOptimize it? How could a process that needs to convert values for
>downloaded more manuals than I've time to read, but am making a lot of
>progress on identifying the conversion (DBISAM -> FB) issues.
>
>In DBISAM, there is the ability to indicate that an index is not case
>sensitive. Thus, "Abc" would be right next to "ABC" rather than far apart
>in the index, the thus (I believe) optimize a query on the field.
comparison be optimal?
>I can't seem to find such an animal in FB. Would something this work:?Yes.
>
>Select * from Clients where Upper(Clients.Name) like 'SMITH%'
If you have certain char or varchar columns that need a case-insensitive
search frequently, create an additional column of the same length which is
populated automatically by before insert and before update triggers and
stores your value as upper case. Index this proxy search column instead of
the actual column.
e.g.
create trigger bi_proxy_last_name for customer
active before insert position 0
as
begin
if (new.last_name is not null) then
new.proxy_last_name = upper(new.last_name);
end
create trigger bu_proxy_last_name for customer
active before update position 0
as
begin
if (new.last_name <> old.last_name
and new.last_name is not null) then
new.proxy_last_name = upper(new.last_name);
end
heLen