Re: mySQL overhead: Tweaking Scripts for Speed
| From: | Chris Sherwood | Date: | Fri, 05 Sep 2003 15:44:15 +0000 |
| Subject: | Re: mySQL overhead: Tweaking Scripts for Speed | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-161775@lists.php.net to get a copy of this message | ||
check this out dan
It may help
http://www.mysql.com/doc/en/EXPLAIN.html
----- Original Message -----
From: "Dan Anderson" <dan@mathjunkies.com>
To: "PHP List" <php-general@lists.php.net>
Sent: Friday, September 05, 2003 8:38 AM
Subject: [PHP] mySQL overhead: Tweaking Scripts for Speed
> I'm trying to figure out ways to tweak my scripts for performance.
>
> I've figured out that all mySQL queries should use indexed ids for
> speed. (For anyone who doesn't know: mySQL indexes fields with PRIMARY
> KEY, UNIQUE, or AUTO_INCREMENT in them. This means they're stored in
> binary trees internally, so access time is negligible for an INT PRIMARY
> KEY AUTO_INCREMENT).
>
> But how much overhead is there in:
>
> $link = mysql_connect($hostname,$username,$password) or die("");
> $db = mysql_select_db($database,$link) or die("");
>
> Would it be beneficial to run a single one at the beginning of every
> script? Currently I have a bunch of functions each with their own
> calls.
>
> Best Regards,
>
> Dan
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>