RE: [PHP-WIN] Creating a select and speed.

From: Date: Wed, 03 Jan 2001 13:56:51 +0000
Subject: RE: [PHP-WIN] Creating a select and speed.
Groups: php.windows 
Request: Send a blank email to php-windows+get-4761@lists.php.net to get a copy of this message
Currently I am using LIKE with the input followed by percent or a blank field represented by a %, but I fear it will be too slow so figured I would ask. Back to the drawing board I guess, thanks for the input. Larry H. On Wednesday, January 03, 2001 2:19 AM, kill-9 [SMTP:kill-9@kill-9.dk] wrote: > 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 > > > >

« previous php.windows (#4761) next »