note 19252 added to function.mysql-query
| From: | edanley at cyberdudeNOSPAM dot com | Date: | Thu, 21 Feb 2002 01:22:07 +0000 |
| Subject: | note 19252 added to function.mysql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-26869@lists.php.net to get a copy of this message | ||
I have a MySQL database where I have around 600 or rows. I have logic where people can request to
see every row, which I then display in a nice looking table. But the sql_query I had been doing (my
hosting company had PHP 4.0.4 installed) was taking rediculously long, maybe like 7 seconds or
whatever. I found this sql_unbuffered_query command, which requires at least 4.0.6. So, I had my
hosting company upgrade to 4.0.6 and now I've tried sql_unbuffered_query. But it still looks
like it's taking roughly the same time to show all of the rows.
Here is the database structure:
$result = mysql_query("CREATE TABLE IF NOT EXISTS Widgets ( lastupdated timestamp(14) NOT NULL,
name varchar(100) NOT NULL, PRIMARY KEY(name), type varchar(30) NOT NULL, company varchar(100) NOT
NULL, rate1 varchar(3) NOT NULL, rate2 varchar(3) NOT NULL, rate3 varchar(3) NOT NULL, rate4
varchar(3) NOT NULL, rate5 varchar(3) NOT NULL, rateavg varchar(6) NOT NULL, notes varchar(255)
NULL)")
Here is the command I'm running:
$res = mysql_unbuffered_query("select lastupdated, name, type, company, rate1, rate2, rateavg,
notes from Widgets order by $sort $sortord $sortbyname");
Can someone please help me with performance enhancement ideas? Thx.
--
http://www.php.net/manual/en/function.mysql-query.php
http://master.php.net/manage/user-notes.php?action=edit+19252
http://master.php.net/manage/user-notes.php?action=delete+19252
http://master.php.net/manage/user-notes.php?action=reject+19252