Subject Re: Can someone explain to me what's the best way to do this?
Author andrew_s_vaz
Adam,

> Imagine you have 10 names, and your ascending index looked a bit like
> this (OK, it doesn't look like this, but lets not get technical, I am
> answering a why question):
>
> Adrian
> Anthony
> Aarom
> Ben
> Bob
> Cameron
> James
> Jenny
> Karen
> Martin
>
> The following query would be easy
>
> select name
> from employee
> where name like 'J%'
>
> FB would know by the index that it only needed to return James and
Jenny.
>
> But how could that index help if your query went something like
>
> select name
> from employee
> where name like '%i'
>
> By inspecting 1 by 1, we know it is only Adrian and Martin, but the
> index can't help on this.
>
> You could possibly create a table called pattern with an index on it,
> and maintain it using triggers on the employee table, but it would
> grow very big. It is a trade-off you will have to decide the best way
> of handling.
>
> Sorry I can't be of more help.

You've helped a lot. Thanks. :-)
Andrew