On Friday 06 April 2001 01:57, you wrote:
> NOTE(!): LIKE '%foo%' DOES NOT SCALE. It looks like you are making a
> phone book, which could get to be a lot of numbers. On the other hand
> 'foo%' oddly scales to hundreds of thousands of records without any
> problems (make sure it's key'd!).
Well, if you think a bit about it it's not odd at all. For "%foo%" the DB
has to examine the entire string until it finds an occurence of "foo" or
until it reaches the end - and it can not use any (normal) index. for it.
For "foo%" it just has to examine the first three chars - that's even
faster than "WHERE phone = 'foobar-something'"
and works very nicely with a perfectly normal index.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
I saw God --------- and she was black.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]