[PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread Dan Anderson
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

Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread Chris Sherwood
check this out dan It may help http://www.mysql.com/doc/en/EXPLAIN.html - Original Message - From: Dan Anderson [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Friday, September 05, 2003 8:38 AM Subject: [PHP] mySQL overhead: Tweaking Scripts for Speed I'm trying to figure

Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread Chris Shiflett
--- Dan Anderson [EMAIL PROTECTED] wrote: I've figured out that all mySQL queries should use indexed ids for speed. (For anyone who doesn't know: mySQL indexes fields with ... You can create an index yourself: KEY [index_name] (index_col_name,...) Find more on this page:

Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread CPT John W. Holmes
From: Dan Anderson [EMAIL PROTECTED] 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

Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread Dan Anderson
While multiple connections will just return the first connection, anyhow, why do the extra work, right? Yes that was what I was thinking. But I was also thinking that I would need to global the $link and $db variables and run mysql_query() with them in options. So I'm wondering how much work

Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread CPT John W. Holmes
From: Dan Anderson [EMAIL PROTECTED] While multiple connections will just return the first connection, anyhow, why do the extra work, right? Yes that was what I was thinking. But I was also thinking that I would need to global the $link and $db variables and run mysql_query() with them