Re: Creating a select and speed.
| From: | kill-9 | Date: | Wed, 03 Jan 2001 08:18:36 +0000 |
| Subject: | Re: Creating a select and speed. | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-4752@lists.php.net to get a copy of this message | ||
I am assuming that you are using like for your searches. Like is always slow
especially if you do something like
where name like "%Smith%";
it would be faster to do
where name like "John %";
so doing where name like "%" is not a good idea if you are thinking about
speed. You should use php to build your select on what data they did
submit. If it is still slow try adding some indexes.
good luck
kill-9
www.kill-9.dk for all your mysql and php needs.
----- Original Message -----
From: "Larry Hotchkiss" <lhotch@unicap.com>
To: "'PHP windows list'" <php-windows@lists.php.net>
Sent: Tuesday, January 02, 2001 3:48 PM
Subject: [PHP-WIN] Creating a select and speed.
> php4, apache, mysql. I have a form to gather input to do a search. The
> form contains 9 fields all of which can be filled in OR blank. Is it more
> beneficial(speed wise) to create the select statement by determining
> weather vars are set and then just using the ones that have values from
the
> form or would the performance be acceptable by including all vars in the
> select and simply assinging them a '%' if blank when the form is
submitted?
> I estimate table size to be no larger that 11 cols with 500,000 records.
>
> ---------------------------------
> Larry Hotchkiss
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>