On Fri, 11 Jan 2002, Nick Fankhauser wrote:
>
> > I don't beleive indexes will improve SELECT using LIKE.
>
> I wondered about that too, so I did a test using a database I'm working
> with. The results indicate that it helps substantially- here is my terminal
> log file:
[snip]
an interesting (?) addendum to this. Yes it does help substantially,
unless your wildcharacter has characters after it.
> staging=# explain select count(*) from actor where actor_full_name like
> 'A%';
try: explain select count(*) from actor where actor_full_name like '%a';
not too relevant for searches here, but occasionally it could be. my
situation was having a merged last name + zipcode field, instead of having
two separately indexed fields. Found out i couldn't do the job i wanted
that way.