|
Posted by Toby A Inkster on 06/24/07 08:35
Derrick Shields wrote:
> select * from people where last_name like '%smith%'
Even with indexes, this will be *slow*. This would be much faster:
select * from people where last_name like 'smith%'
and this, slightly faster still:
select * from people where last_name='smith'
> Also, I tried creating indexes on first_name and last_name columns, and
> it seems like it's just freezing. It sat there for hours and never
> responded. Is the database getting too big at this point to create
> indexes?
Just be patient.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 3 days, 12:12.]
A New Look for TobyInkster.co.uk
http://tobyinkster.co.uk/blog/2007/06/22/new-look/
Navigation:
[Reply to this message]
|